[Question] How to know that browser is opened with Puppeteer
See original GitHub issueIs there a way to know (from page’s JS) that the browser is running with Puppeteer? I saw the tip to check for headless
string in userAgent
, but I’m running with headless: false
(testing extension).
I’d like to switch some features if the extension is run in tests.
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
puppeteer : how check if browser is still open and working
You can use browser.on('disconnected') to listen for when the browser is closed or crashed, or if the browser.disconnect() method was called.
Read more >Getting to Know Puppeteer Using Practical Examples
Puppeteer launches the browser in a headless mode by default, which merely uses the command line. Also - a headful mode, for opening...
Read more >How To Write End-to-End Tests in Node.js Using Puppeteer ...
The web crawler will open a browser, navigate to the Login page, and enter the credentials, then the test script will run to...
Read more >Puppeteer | Puppeteer
// Type into search box. await page.type('.devsite-search-field', 'Headless Chrome'); // Wait for suggest overlay to appear and click "show all results". const ...
Read more >How to Use Puppeteer With Node.js - freeCodeCamp
Puppeteer lets you automate the testing of your web applications. With it, you can run tests in the browser and then see 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 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
@skyiea you can launch chrome with a custom user agent:
Hope this helps
@skyiea How about setting a user agent like ‘puppeteer’, so that you know from
window.navigator.userAgent
?