Firefox Web Console Disabled?

JavascriptHtmlFirefox

Javascript Problem Overview


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 disabled by a script on this page

The same webpage can print messages in Chrome Console but not Firefox. I opened the same webpage in another computers' Firefox (don't know what version) Web Console can print messages. My Firefox version is the latest, 8.0.

Javascript Solutions


Solution 1 - Javascript

This happens when the page itself defines a global variable called console, for example. If the page is browser-sniffing to decide whether to define it, the behavior could differ in different browsers.

In the case of Firefox it also happens when Firebug is installed and its console is enabled, since that overrides the default window.console.

Solution 2 - Javascript

I had the same exact error message, and once I removed firebug, it went away.

I'm not saying you should remove firebug, I love firebug, but that is most probably the source of the error for you as well. One more note, the error was still there even if firebug was turned off (disabled) for that particular page.

Solution 3 - Javascript

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: https://stackoverflow.com/questions/7089443/restoring-console-log

Solution 4 - Javascript

Right click over firebug console tab and uncheck "enabled" option (the first one).

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionyeeenView Question on Stackoverflow
Solution 1 - JavascriptBoris ZbarskyView Answer on Stackoverflow
Solution 2 - JavascriptCosta MichailidisView Answer on Stackoverflow
Solution 3 - JavascriptdominikView Answer on Stackoverflow
Solution 4 - JavascriptPanta AlejandroView Answer on Stackoverflow