Synchronous XMLHttpRequest on the main thread is deprecated warning
hanneswidrig opened this issue · 5 comments
The only browsers this extension supports are Chrome and Firefox. I had no idea that Edge could even load it.
The extension only uses sync XHR to support "reload and profile" by the way. Are you using that feature?
Edge Insider is based on Chromium 76. I do use the "reload and profile" feature sometimes, if it's supposedly to automatically detect when the page finishes loading, like the built-in Chrome devtools, that's not working in either Chrome 74 or Chromium 76.
I get the same warning in Chrome 74, so I don't think it's Edge Insider specific.
Ah. I misread your initial report. I thought you were saying it was a runtime error in Edge.
Yes, the warning is logged in Chrome too- but there is no other way for an extension to eagerly inject a script into the context of a website without using sync XHR. If you're interested in more background info, check out PR #35.
I spoke with a Chrome extension dev rel (@dotproto) about this issue. My take away was that he agreed this was a reasonable use of sync XHR, and he did not think it was likely that support would be removed without the Chrome team first offering an alternative API for this.
Looks like adding -url:chrome-extension://nfbeoglmnmcfolbonpjonlgageflmghb/build/injectGlobalHook.js
in the Chome Dev Tools console is the only way to suppress the warning.
To me, this has the feel of a browser bug (in that there's no API for performing a valid use case). I don't think there's any action we can take on our side other than alert the Chrome folks (which we've done)