"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)
Tracking
(firefox-esr91 unaffected, firefox95 wontfix, firefox96 wontfix, firefox97 verified, firefox98 verified)
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)
48 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details | Review |
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:
Assignee | ||
Comment 1•2 years ago
|
||
Oh I thought we already had something for that.
I don't have the time to look into it properly right now, but the log is emitted from https://searchfox.org/mozilla-central/rev/b3933df6e119bd6caf5d9e5868670348ec26dee3/devtools/client/webconsole/webconsole-ui.js#421-423 , and the flag that controls it is sent from https://searchfox.org/mozilla-central/rev/b3933df6e119bd6caf5d9e5868670348ec26dee3/devtools/server/actors/resources/document-event.js#71-72 , and is built from https://searchfox.org/mozilla-central/rev/b3933df6e119bd6caf5d9e5868670348ec26dee3/devtools/server/actors/webconsole/listeners/document-events.js#160-175
I'll dig deeper later today
Comment 2•2 years ago
•
|
||
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:
- the spec doesn't define
hasNativeConsoleAPI
for this event (https://searchfox.org/mozilla-central/rev/b3933df6e119bd6caf5d9e5868670348ec26dee3/devtools/shared/specs/webconsole.js#96) - the actor doesn't forward
hasNativeConsoleAPI
in onDocumentEvent (https://searchfox.org/mozilla-central/rev/b3933df6e119bd6caf5d9e5868670348ec26dee3/devtools/server/actors/webconsole.js#1822)
Assignee | ||
Comment 3•2 years ago
|
||
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.
Comment 5•2 years ago
|
||
bugherder |
Comment 6•2 years ago
|
||
Is this something you wanted to nominate for Beta uplift?
Assignee | ||
Comment 7•2 years ago
|
||
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:
Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Comment 8•2 years ago
|
||
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.
Comment 9•2 years ago
|
||
Comment on attachment 9258441 [details]
Bug 1749123 - [devtools] Include hasNativeConsoleAPI in documentEvent. r=jdescottes.
Approved for 97.0b3.
Comment 10•2 years ago
|
||
bugherder uplift |
Comment 11•2 years ago
|
||
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.
Description
•