F12 Developer Tools internals call into user-created JS

Confirmed Issue #13871250 • Assigned to Brandon W.

Details

Created
Sep 21, 2017
Privacy
This issue is public.
Found in
  • Microsoft Edge
  • Internet Explorer
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

The developer tools calls into user-created JavaScript when (it appears to be) traversing nodes to show in the inspector. For example, the attached page does only one thing: it wraps the Node.prototype.parentNode getter with a function that logs to the console before and after calling the wrapped (built-in) function. With the developer tools open, this function ends up logging to the console even though nothing else happens on the page. This makes it extremely difficult to debug any code that modifies these prototypes (polyfills, for example) because merely having the developer tools open will often cause the page’s behavior to change! It’s important to note that this problem isn’t unique to parentNode: the developer tools seem to call into lots of other user-created code by referencing functions and properties through user-modifiable objects. The developer tools should either (a) capture and only use references to the functions it expects to call before the user has an opportunity to modify them or, ideally, (b) avoid looking up these functions through the same mechanism as user code completely and use an internal API instead.

Attachments

Comments and activity

  • Microsoft Edge Team

    Changed Assigned To to “Brandon W.”

    Changed Status to “Confirmed”

You need to sign in to your Microsoft account to add a comment.

Sign in