question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] devtools plugin not working in headless mode

See original GitHub issue

Hi team!

I’ve started using the puppeteer-extra-plugin-devtools package for remote debugging but have found that when running headless I receive 404 errors when attempting to view pages at the tunnel url. When running headful everything works as expected however.

To reproduce the issue you can run the code below, visit the public tunnel url, enter the credentials. You’ll see something like the below screenshot:

landingpage

But when clicking on one of the pages you’ll see the below 404 error.

404error

Code Snippet

const puppeteer = require('puppeteer-extra');
const devtools = require('puppeteer-extra-plugin-devtools')();
puppeteer.use(devtools);

(async () => {
    const browser = await puppeteer.launch({ headless: true });
    await devtools.createTunnel(browser);
    const page = await browser.newPage();
    // this could be any url below, I just put a small example webpage to load as an example
    await page.goto('https://meyerweb.com/eric/tools/dencoder/');
    await page.waitForTimeout(60000);
    await browser.close();
    process.exit(0);
})();

I’m running recent versions of everything but have tried with some older versions of puppeteer and can’t get headless devtools to work. Also I run macOS but have had the same issue running on amazon linux 2.

Versions

System: OS: macOS 11.6 CPU: (16) x64 Intel® Core™ i9-9980HK CPU @ 2.40GHz Memory: 1.64 GB / 32.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.10.0 - /usr/local/bin/node Yarn: 1.22.4 - ~/.yarn/bin/yarn npm: 7.24.0 - /usr/local/bin/npm npmPackages: puppeteer: ^10.2.0 => 10.4.0 puppeteer-extra: ^3.1.18 => 3.2.1 puppeteer-extra-plugin-devtools: ^2.3.0 => 2.3.1 puppeteer-extra-plugin-stealth: ^2.7.10 => 2.8.1 puppeteer-page-proxy-abowcut: ^1.2.14 => 1.2.15

Thank you! Thank you for all of your hard work on these plugins, they really are the best and you guys are the best!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:18 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
berstendcommented, Sep 25, 2021

Should be fixed in #567- thanks @abowcut 👍

Successfully published:
 - puppeteer-extra-plugin-devtools@2.3.2
0reactions
kurohoancommented, Feb 17, 2022

@abowcut I would like a reply when you are available.

Read more comments on GitHub >

github_iconTop Results From Across the Web

706008 - Extensions support in headless Chrome - Monorail
The `Cast` experimental DevTools Protocol API does not work in headless mode because the functionality depends on a built-in extension. Without ...
Read more >
Python Selenium with ChromeDriver Headless: Fails To Start
I can start it fine from the command line (there is a GPU error but it seems not to cause any problems.) However,...
Read more >
Debugging Puppeteer - Chrome Developers
Turn off headless mode. Sometimes it's useful to see what the browser is displaying. Instead of launching in headless mode, launch a full ......
Read more >
Headless Chromium
Navigate to http://localhost:9222 in another browser to open the DevTools interface or use a tool such as Selenium to drive the headless browser....
Read more >
It is *not* possible to detect and block Chrome headless - Intoli
This can be run with node test-headless-initial.js and it will produce a ... Here's an example of doing this interactively in the Chrome...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found