Details

Steps to reproduce

In the process of modifying our Chrome extension to run within Edge as well.

One of our content scripts in our extension is a minified version of jQuery. When trying to debug our extension, a syntax error is reported in the console, but not attributed to any specific script (when following the error link it simply jumps to the bottom of the test page which has no scripts of its own).

Through process of elimination, I determined that it was my content script jquery-min.js that was causing the error, but I still don’t know what the error is or why it is triggering. Loading the same script by directly adding it to the webpage instead of in the content of an extension content script does not trigger any error.

It is possible that there is something about the context of content scripts within Edge that is triggering a bug in jquery-min.js but I can’t tell because I can’t debug the error.

Thanks for filing this bug! JQuery throws these exceptions because it uses certain pseudo-selectors that Edge does not support. These exceptions are meant to be caught in JQuery code (they’re all wrapped in try/catch statements), but unfortunately, we have a bug (https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7698441/) in Edge where exceptions originating from content scripts are thrown in both the content script JS engine and the page JS engine. As a result, these exceptions are properly caught by JQuery in the content script JS engine, but are left to bubble up to the top level in the page JS engine (which is why you see them in the console). We’re currently working on a fix for this issue, but if you have any other questions or concerns, feel free to reach out on the other bug’s comment thread!

Suggesting a root cause

Help make the web just work! Identifying a root cause helps us resolve issues more quickly. If you have a theory for the root cause or have identified and reduced a reproducible bug, include a description and any relevant code or URLs in your comment and mark it as a root cause suggestion. Our engineers will take a look and update the bug with the results of our investigation.