Weird behavior in Adjacent Chrome Tabs
See original GitHub issueHi, I have written an example and the source code is here, these are the steps for reproduce:
- Open example in two adjacent Chrome Tabs (I am using Linux Mint 18) and Open the JS console in both. Adjacent Tabs means both are in the same window
- Copy
Your Offer
from first Tab toRemote Offer
in second Tab and press Save - Copy the answer from second Tab to first Tab
Remote Answer
input and press Save button
Expected:
- JS console should show
CONNECTED
in both Tabs
Actual:
- Only the offerer Tab show
CONNECTED
message
Note that if you probe it with Tabs in different windows this works as expected.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Weird tab close icon behavior on chrome or new feature?
I just noticed that as soon as I close a single tab on Chrome (version 23.0.1271.64 m), all the other tabs display the...
Read more >Chrome in full screen weird behavior when pressing option + ...
Yeah it's a visual bug. Option + Command + M is a shortcut to minimise all the windows of the frontmost app to...
Read more >Strange behavior with Chrome tabs -- newly opened ones not ...
Clicking + to open a new tab does open a new tab, but it's not visible unless I go full screen (or back...
Read more >5212 - BUG: Chrome does not respond to a mouse click at times
I have had this problem, but only after Chrome is running for some time, with multiple tabs open. In my case, I recall...
Read more >Did I Just Fix Chrome's Audio? | by Ilan Bar-Magen - UX Planet
The weird default behavior of letting each and every tab to play sounds ... plus all of the surrounding noises, and the live...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Seems
self._channel.onopen
is not being fired when connecting two tabs in the same window.What is strange is that
self._channel.onmessage
is still being fired, hence why @matthewtoast 's solution works.Created a PR to always fire “connect” before emitting data. This should allow you to use normal data to determine connection, instead of sending many heartbeats (assuming you send data on connect to the other peer).
This is definitely a Chrome bug, and we won’t have a real solution until they fix it.
My work around, FWIW: Once the offerer (initiator) hears the
connected
event, have it begin sending a regular ‘heartbeat’ message. The non-offerer (guest) will begin receiving this data despite never having fired its ownconnected
event (it is connected even though it never says so!). On the non-offerer (guest) side, treat the first ‘heartbeat’ you receive as a substitute for theconnected
event.