Closed Bug 1749123 Opened 2 years ago Closed 2 years ago

"The Web Console logging API (console.log, console.info, console.warn, console.error) has been disabled by a script on this page" warning in browser console

Categories

(DevTools :: Console, defect)

Firefox 93
Desktop
All
defect

Tracking

(firefox-esr91 unaffected, firefox95 wontfix, firefox96 wontfix, firefox97 verified, firefox98 verified)

VERIFIED FIXED
98 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox95 --- wontfix
firefox96 --- wontfix
firefox97 --- verified
firefox98 --- verified

People

(Reporter: soeren.hentzschel, Assigned: nchevobbe)

Details

(Keywords: regression)

Attachments

(1 file)

STR:

Open the browser console.

Actual:

The following warning appears in the browser console:

The Web Console logging API (console.log, console.info, console.warn, console.error) has been disabled by a script on this page.

Expected:

The warning should not appear.

mozregression pointed me to the following regression range:

https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=571fa8e5ae5150f4207fdcd8089e9de6e98c1198&tochange=a2ddceb4895bbb56add6ceceacb1358b99c9b074

Flags: needinfo?(jdescottes)
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Flags: needinfo?(jdescottes)

Thanks for picking this up. Just sharing what I found: we get the resource via a legacy listener, built around the "documentEvent" event from the webconsole and there are 2 issues with that:

In the Browser Console, document-event resources are retrieved from a
legacy listener built on top of the documentEvent event, sent by the
webconsole actor.
documentEvent wasn't including hasNativeConsoleAPI, and we were displaying
a misleading overriden console API message there.
This patch fixes this and adds a test case to make sure we don't regress.
Funnily, the mochitest test harness does override the global's console
property, and we have to reset it in the test to make sure the warning message
is not displayed.

Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/eff8164a9cd2
[devtools] Include hasNativeConsoleAPI in documentEvent. r=jdescottes,devtools-backward-compat-reviewers.
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch

Is this something you wanted to nominate for Beta uplift?

Flags: needinfo?(nchevobbe)
Flags: in-testsuite+

Comment on attachment 9258441 [details]
Bug 1749123 - [devtools] Include hasNativeConsoleAPI in documentEvent. r=jdescottes.

Beta/Release Uplift Approval Request

  • User impact if declined: a misleading warning message will be displayed in the browser console
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: 1. Open the browser console

-> there shouldn't be the following warning message:

⚠️ The Web Console logging API (console.log, console.info, console.warn, console.error) has been disabled by a script on this page.

  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Browser Console only, with an automated test
  • String changes made/needed:
Flags: needinfo?(nchevobbe)
Attachment #9258441 - Flags: approval-mozilla-beta?
Flags: qe-verify+
QA Whiteboard: [qa-triaged]

Reproduced this on an affected Nightly build from 2022-01-08, on macOS 10.14 and Win 10 x64.

Verified fixed on 98.0a1 (20220112095252) under macOS 10.14, Win 10 x64 and Ubuntu 20.04. The warning no longer appears in the browser console.

Status: RESOLVED → VERIFIED
Flags: qe-verify+

Comment on attachment 9258441 [details]
Bug 1749123 - [devtools] Include hasNativeConsoleAPI in documentEvent. r=jdescottes.

Approved for 97.0b3.

Attachment #9258441 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Verified fixed on 97.0b3 using a treeherder build (Build ID: 20220112214014) across the following platforms: macOS 10.14, Windows 10 x64 and Ubuntu 20.04.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: