question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Weird behavior in Adjacent Chrome Tabs

See original GitHub issue

Hi, 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 to Remote 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:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
t-mullencommented, Jun 6, 2017

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.

3reactions
matthewtoastcommented, May 21, 2017

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 own connected 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 the connected event.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found