-
Notifications
You must be signed in to change notification settings - Fork 9.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
backgroundpage.on('console')
not working
#4300
Comments
Hey, maybe it's just happening before your listener being setup ? await backgroundPage.evaluate(() => console.log('hi')); anywhere before your listeners in your example.js i don't see anything, but anywhere after i'll see 'bg: hi' |
Hey @xse thank you for the suggestion as this is a classic mistake. Have a good one too! |
@xse Thank you so much for your precious help ! So apparently Chrome has a "hidden" extension called I think that in my original code, I was calling As you stated, I guess that the Again, thank you so much for your help, I spent all day yesterday faking the |
Chrome has a set of component extensions - e.g. CryptoTokenExtension that helps with 2FA. These extensions are loaded regardless of the `--disable-extensions` flag we already pass. To disable these extensions, we need to pass additional `--disable-component-extensions-with-background-pages` flag. Fix puppeteer#4300
We should disable the component extensions by default - submitted the #4704 for this. |
Chrome has a set of component extensions - e.g. CryptoTokenExtension that helps with 2FA. These extensions are loaded regardless of the `--disable-extensions` flag we already pass. To disable these extensions, we need to pass additional `--disable-component-extensions-with-background-pages` flag. Fix #4300
Steps to reproduce
What steps will reproduce the problem?
git clone https://github.com/pyrho/puppeteer-bug.git
yarn
node example.js
The repo for this issue: https://github.com/pyrho/puppeteer-bug
What is the expected result?
Messages (
console.log
)from the background page are caught by thebackgroundPage.on('console')
handler.`bg: PORT CONNECTED" should print in the node console.
What happens instead?
Messages are not caught by the handler.
When manually inspecting the background page, we can see that the message is printed in the console tab:
Thank you for your time and this awesome project :)
The text was updated successfully, but these errors were encountered: