ConsoleMessage type and text not interoperable between Chrome and Firefox
See original GitHub issueSteps to reproduce
Tell us about your environment:
- Puppeteer version: 5.2.0
- Platform / OS version: macOS 10.15.5
- Node.js version: v10.16.3
What steps will reproduce the problem?
Please include code that reproduces the issue.
'use strict';
const puppeteer = require('puppeteer');
async function main() {
for (const product of ['chrome', 'firefox']) {
const browser = await puppeteer.launch({product});
const page = await browser.newPage();
await page.goto('about:blank');
const msgPromise = new Promise((resolve) => {
page.on('console', resolve);
});
await page.evaluate('console.log("message")');
const msg = await msgPromise;
console.log({
product,
type: msg.type(),
text: msg.text(),
args: msg.args(),
});
await browser.close();
}
}
main();
Output from running the above is:
{ product: 'chrome',
type: 'log',
text: 'message',
args:
[ JSHandle {
_disposed: false,
_context: [ExecutionContext],
_client: [CDPSession],
_remoteObject: [Object] } ] }
{ product: 'firefox',
type: 'verbose',
text: [ 'message' ],
args: [] }
What is the expected result?
The msg.type() and msg.text() should be the same for Chrome and Firefox, to make it possible to use console messages without switching on which product is under test.
What happens instead?
- Chrome:
msg.type()is “log” andmsg.text()is “message”. - Firefox:
msg.type()is “verbose” andmsg.text()is an array with a single item “message”
msg.args() is also different, but I don’t know what it should be, and am not using it myself.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Console messages — Firefox Source Docs documentation
Console messages¶. Most of the Web Console is occupied by the message display pane: Screenshot of the web console, highlighting the messages area....
Read more >471020 - Add X-Content-Type-Options: nosniff support to Firefox
It has no Content-Type and we still parse it as HTML. ... is that there's already interoperability problems with this header between IE...
Read more >console - Web APIs - MDN Web Docs
Chrome Edge Firefox
console Full support. Chrome1. Toggle history Full support. Edge12. Toggle history Full s...
assert Full support. Chrome1. Toggle history Full support. Edge12....
Read more >1423098 - Remove support for SMIL's accessKey feature
Issues with the layout or rendering of SVG content and interacting with the SVG DOM. Example bugs: SVG marker can not be clipped...
Read more >Display alerts for SameSite cookie changes in the developer ...
The messages should not have any interoperability or compatibility risk. ... the output of the messages, resulting in a text diff from the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Just checked and there is no difference anymore between Chrome and Firefox. Both output the following:
Thanks @whimboo!