Live data from Hacker News

Show HN: AcrossTabs – Easy communication between cross-origin browser tabs

github.com

1–10 of 27 posts

Re: Show HN: AcrossTabs – Easy communication between cross-origin browser tabs

#4

Looks like a nice library, though using a default of `*` for Origin seems like an invitation for people to shoot themselves in the foot.

Yea, that's totally true. I would recommend using an origin property to be used every time an instance of the Library is created. Please refer: https://github.com/wingify/across-tabs#usage

Re: Show HN: AcrossTabs – Easy communication between cross-origin browser tabs

#5
post #2

I was puzzled when I first saw cross tab communication in impress.js for their slide control tab (slid.es) and I am still wondering about the proper use case of this feature today. Isn't this a security nightmare?

It maps back to window.postMessage. There's a security concerns section on Mozilla's docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/post...

All boils down the sender using a specific target, and the receiver remembering to check the origin.

Re: Show HN: AcrossTabs – Easy communication between cross-origin browser tabs

#6
post #4

Looks like a nice library, though using a default of `*` for Origin seems like an invitation for people to shoot themselves in the foot.

Yea, that's totally true. I would recommend using an origin property to be used every time an instance of the Library is created. Please refer: https://github.com/wingify/across-tabs#usage

Then don't have a default that works without doing so. Really, defaults like this lead to "works, ship it" and totally unnecessary cases of vulnerable software.

Re: Show HN: AcrossTabs – Easy communication between cross-origin browser tabs

#8

I think I understand what this does, but I don't think I understand the use case. Does anyone have any real-world examples of where this helps?

If you build browser-based applications that open websites in new tabs and programatically interact with them then I imagine it'd be handy. I'm making a test builder to generate user scripts and e2e tests more easily, so having the app open in one tab talking to a site you're working with in another would be a possible use case. I've actually written my app as Chrome devtools extension though, so it already has access to everything through a background script and an injected content script. If I ever move it to being web-based I'd use something like this to do communication between tabs.

Looking at Wingify's website it seems they're doing something similar with A/B testing - they (presumably) have an app that sits in one tab and a two of copies of the target site in two more tabs, so changes made in their app are reflected in the two versions of the target site. That's a total guess though.

Re: Show HN: AcrossTabs – Easy communication between cross-origin browser tabs

#9

I think I understand what this does, but I don't think I understand the use case. Does anyone have any real-world examples of where this helps?

We had this exact problem before, we had a single-page-app console for sales agents and they would open up a lot of tabs, one for each conversation. If we didn't sync between the tabs, a lot of alerts and whatnot would have been duplicated.
Post reply on HN