Live data from Hacker News

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

github.com

21–27 of 27 posts

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

#21
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?

Doesn't most Oauth2 things work that way?

http://www.riskcompletefailure.com/2013/03/postmessage-oauth...

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

#22
post #17

Earlier quoted context omitted.

Don't use unsafe defaults ffs, that's how things get exploited.

Does that mean, the library should not act when an origin is not specified and throw some kinda message in the console? How can it be enforced? Any suggestions? Users can also make it a bit more complicated while using `*` to get hacked by accepting responses which match some kinda pattern(it's not bullet-proof though) and simply discarding others.

Put the wildcard functionality behind a setter with a long name and make the default the current domain?

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

#24
post #17

Earlier quoted context omitted.

Does that mean, the library should not act when an origin is not specified and throw some kinda message in the console? How can it be enforced? Any suggestions? Users can also make it a bit more complicated while using `*` to get hacked by accepting responses which match some kinda pattern(it's not bullet-proof though) and simply discarding others.

Put the wildcard functionality behind a setter with a long name and make the default the current domain?

Put it behind a setter with "doNotUseOrYouWillBeFired" in the function name.

https://github.com/facebook/react/blob/80bff5397bf854750dbe7...

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

#25
post #18
post #6

Earlier quoted context omitted.

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.

Does that mean, the library should not act when an origin is not specified and throw some kinda message in the console?

Yes, a required argument. It's not uncommon. Think API keys.

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

#26
post #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.

Is that cross origin though?

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

#27
post #6
post #4

Earlier quoted context omitted.

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.

Second this. A lot of developers will just drop it in without reading the caveats. Just make the origin a mandatory parameter.
Post reply on HN