devtools-backend icon indicating copy to clipboard operation
devtools-backend copied to clipboard

Runtime.overwriteConsole problem

Open johneisenheim opened this issue 6 years ago • 2 comments

Hi @christian-bromann First of all, thanks for your amazing project (and thesis). I'm experiencing some problems on using your devtools-backend: running on my HbbTV the line window.console = domains.Runtime.overwriteConsole.call(this, window.console) cause a wrong overwrite of console object into the javascript environment. More in depth, every time I use a console.log it throws an exception (it seems that the overwrite is not done properly).

Can you help me in some way?

P.S.: debugging the application through a screen log, the console object without importing your script in the <head> (to prevent the overwrite) contains a single object memory, that is an empty object. I'm not seeing the log, debug, error, ... methods. Very weird...

Thanks for your help!

johneisenheim avatar May 09 '18 10:05 johneisenheim

it throws an exception

What exception is thrown?

christian-bromann avatar May 09 '18 13:05 christian-bromann

@christian-bromann a custom exception I throw in a simple try-catch block, like this:

<script>
        try {
            console.log('hi there');
        } catch (e) {
            var p = document.getElementById('content');
            p.innerHTML = "ops...";
        }
</script>

It seems that console.log is not a function anymore!

Thanks again.

johneisenheim avatar May 09 '18 14:05 johneisenheim