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.

MS Edge compatibility issue with processQueue()

See original GitHub issue

This is a little hard to reproduce, and I think there is an issue with how Edge handles iframes. We have no problem with this same app in Chrome or Safari or Firefox.

What I have observed is that when my app loads for the first time, in a fresh tab (disabling the cache in the devtools doesn’t work, this needs to be a fresh tab), the first event object that is passed into processQueue results in the boolean event.source === global returning false.

I have seen this false value come from two different causes:

  1. The event is a “load” event and not a “message” event. In the course of my debugging, I only saw this a couple of times, so I think there may be a race condition in the way the processQueue function is called.

  2. Much more common, what I observed is that when the page loaded, the event.source was the “main” window, and global was the iframe window object. I don’t know what it is about how my app loads that causes the window objects to be different sometimes, and the same other times. This code seems to be hit three times during load, and only the first time are the window objects different.

Something about the false value is causing the rest of my app not to work, possibly because the queue never gets flushed?

If I change the code so that flushQueue() is called outside the if statement, then things seem to work ok (I am just beginning browser testing with Edge, so it’s possible I’ll find other issues).

processQueue = (function () {
   return hasPostMessage
	? function processQueue (event) {
	      if (event.source === global && event.data === messageName) {
		  event.stopPropagation();
	      }
              flushQueue();   // THIS IS THE LINE I MOVED
         }
       : flushQueue;
})()

I am reluctant to submit this as a Pull Request, because I’m not sure if there are any negative consequences to making this change. I’d appreciate it if you/someone could review this.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
scottlowcommented, Aug 3, 2018

@arqex That seems to have done the trick for the case we were seeing. Thanks for the quick turnaround here!

1reaction
arqexcommented, Aug 2, 2018

I have just published a new version that it’s not using event.source anymore to check what’s the origin of the message. Let me know if it fixed your issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Microsoft Edge Compatibility Issue
Recently updated my home pc to Windows 10, and this error message appears on all internet browsers. Not sure of what to do,...
Read more >
MS Edge - Enable Internet Explorer Compatibility Mode
Enabling Internet Explorer mode in MS Edge · Launch Microsoft Edge. · Open the drop down menu (1) by clicking the 3 dots...
Read more >
Set up Legacy Browser Support for Microsoft Edge in IE mode
If your organization disabled Microsoft Internet Explorer (IE ) on users' devices, Microsoft Edge is responsible for Internet Explorer compatibility.
Read more >
Microsoft Edge | IE mode troubleshooting tips and tricks
IE mode provides legacy browser compatibility support within Microsoft Edge. In this video, you can learn strategies to troubleshoot IE mode ...
Read more >
Microsoft Edge Insider
We adopted the Chromium open source project in the development of Microsoft Edge to create better web compatibility for our customers, ...
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