A simple example: in file index.js, line 10, we have:
When running that code, the expected output in DevTools console would be something like this:
http://127.0.0.1:8080/index.js: hi there index.js:10
But we get this instead:
http://127.0.0.1:8080/index.js: hi there ___vscode_livepreview_injected_script:139
This is due to the fact that the injected code is redefining console calls using createConsoleOverride which is losing the context.
Since createConsoleOverride returns a function that does some processing before calling the corresponding console object method, I don't know how to bind this properly there.
This is not the end of the world, of course, but it makes a bit cumbersome to use tracing messages because clicking on the location of the message will get us to the injected code and not to the proper place when the console object method really happened.
Thanks!
A simple example: in file
index.js, line 10, we have:When running that code, the expected output in DevTools console would be something like this:
But we get this instead:
This is due to the fact that the injected code is redefining
consolecalls usingcreateConsoleOverridewhich is losing the context.Since
createConsoleOverridereturns a function that does some processing before calling the correspondingconsoleobject method, I don't know how to bindthisproperly there.This is not the end of the world, of course, but it makes a bit cumbersome to use tracing messages because clicking on the location of the message will get us to the injected code and not to the proper place when the
consoleobject method really happened.Thanks!