Firefox Web Console Disabled?

后端 未结 4 489
时光说笑
时光说笑 2020-12-02 11:11

How come I get this message from Firefox Web Console

The Web Console logging API (console.log, console.info, console.warn, console.error) has been di

4条回答
  •  天命终不由人
    2020-12-02 11:15

    Here is a JavaScript workaround I used to restore console API after it was set to empty function by a script on the page (works in Firefox 46, tested in Firebug and in greasemonkey script):

    function restoreConsole() {
        var i = document.createElement('iframe');
        i.style.display = 'none';
        document.body.appendChild(i);
        window.console = i.contentWindow.console;
        i.parentNode.removeChild(i);
    }
    

    More info and credentials: Restoring console.log()

提交回复
热议问题