How to load a Chrome Extension url
See original GitHub issueThis is a support/feature/bug - I believe it’s currently not possible to open a Chrome Extension URL with puppeteer…here is what I have:
const puppeteer = require('puppeteer'); // version 1.0.0
(async () => {
const args = puppeteer.defaultArgs().filter(arg => String(arg).toLowerCase() !== '--disable-extensions');
const b = await puppeteer.launch({
headless: false,
devtools: true,
ignoreDefaultArgs: true,
args: args.concat(['--remote-debugging-port=9223'])
});
const browser = await puppeteer.connect({
browserWSEndpoint: b.wsEndpoint() , //`ws://${host}:${port}/devtools/browser/<id>`,
ignoreHTTPSErrors: false
});
const page = await browser.newPage();
await page.goto('chrome-extension://hfnplgaapcnjblpebnhibfcdfllkpaaf/dist/index.html');
})();
but I still can’t launch the chrome extension, I get the same error:
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: net::ERR_BLOCKED_BY_CLIENT
there is no error if I do
await page.goto('http://yahoo.com');
so it has to do with attempting to load the extension, any ideas? I can load the extension url with regular Chrome, so the url is correct. Also, when I load Chromium, I don’t see any extension icons. So my hypothesis is that I need to install/enable the extension in Chromium. For some reason I was thinking that it would just “copy” the extensions from my existing Chrome installation, but that was dumb thinking. Now I have to look up the API for installing a Chrome Extension…thanks for your help
Basically I am looking to launch a Chrome Extension page in a new tab, multiple times…the saga continues…
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (3 by maintainers)
Top GitHub Comments
Ok this worked for me! How exciting
one more question - is there a way to open DevTools at the bottom of the page instead of on the side?
The above code worked for me