Puppeteer for Firefox should be notified on Page events (load, console, domcontentloaded...)
See original GitHub issueSteps to reproduce
Tell us about your environment:
- Puppeteer version: 0.4.2 (
puppeteer-firefox
) - Platform / OS version: Ubuntu 18.04.1 LTS
- Node.js version: v10.14.1
What steps will reproduce the problem?
- Create a file named
main.js
with the following content:
main.js
const b = process.env.PUPPETEER_BROWSER || 'chrome'
const puppeteer = b === 'firefox' ?
require('puppeteer-firefox') :
require('puppeteer')
const path = require('path')
;(async function () {
const browser = await puppeteer.launch();
const page = await browser.newPage()
page.on('load', () => console.log('load'))
page.on('domcontentloaded', () => console.log('domcontentloaded'))
page.on('console', () => console.log('console'))
page.on('pageerror', () => console.log('pageerror'))
await page.goto('file://' + path.join(__dirname, 'index.html'))
await page.close();
await browser.close();
})()
- Create a file named
index.html
with the following content:
index.html
<!DOCTYPE html>
<html>
<head>
<title>Hello</title>
<meta charset="utf-8"/>
</head>
<body>
<script>console.log('hello')</script>
</body>
</html>
- Run the script
main.js
against Chrome:
node main.js
console
load
domcontentloaded
All good with puppeteer
Chrome.
- Run the script
main.js
against Firefox
PUPPETEER_BROWSER=firefox node main.js
(empty)
What is the expected result?
First of all thanks for this amazing project! 😍 👏
Puppeteer for Firefox should trigger the following events and/or the Page
should be notified:
console
load
domcontentloaded
I’m aware that Puppeteer for Firefox is experimental but the documentation page does list these events as “Supported API”: https://github.com/GoogleChrome/puppeteer/tree/master/experimental/puppeteer-firefox#readme
What happens instead?
No event was triggered 😐
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Puppeteer for Firefox should be notified on Page events (load ...
Puppeteer for Firefox should trigger the following events and/or the Page should be notified: console; load; domcontentloaded.
Read more >Puppeteer wait until page is completely loaded - Stack Overflow
What I want is to generate PDF report as soon as Page is loaded completely. I don't want to write any type of...
Read more >Puppeteer documentation - DevDocs
Puppeteer is a Node library which provides a high-level API to control Chromium or Chrome over the DevTools Protocol. The Puppeteer API is...
Read more >Getting to Know Puppeteer Using Practical Examples
We instruct Puppeteer to gather coverage information for JavaScript and CSS files, until the page is loaded. Thereafter, we define ...
Read more >mozilla-release: changeset 551676 ...
remote/test/puppeteer/experimental/puppeteer-firefox/lib/Page.js ... Capture console output - You can listen for the `console` event.
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 FreeTop 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
Top GitHub Comments
@msofyanqusyairi Yes, it’s documented here: https://github.com/GoogleChrome/puppeteer/pull/3657
This should work now with
puppeteer
+ Firefox Nightly. If it’s still not working, feel free to reopen.