Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't use chrome extensions when puppeteer open the chrome

extensions pics The extensions menu can't use when I used the puppeteer open the chrome or chromium.

const browser = await puppeteer.launch({
'executablePath': executablePath,
// 'ignoreDefaultArgs': ['--enable-automation'],
'args': ['--start-maximized', '--enable-automation', '--enable-remote-extensions'],
'devtools': true,
'headless': false,
'defaultViewport': null,
'userDataDir': `${userDataDir}${storeSession.store_name}${storeSession.id}`
})

what should I do?

chromium Version 79.0.3937.0 (Developer Build) (64-bit)

chrome 77.0.3865.120

puppeteer 1.19.0

like image 707
Y WenK Avatar asked Oct 14 '19 01:10

Y WenK


People also ask

Can puppeteer use Chrome extension?

In our opinion Puppeteer is the go-to library if you are working with the Chrome platform. Unlike selenium which supports many programming languages, Puppeteer is tailored to the JavaScript land (for better or worse).

How do I fix chrome extensions not working?

Head to More tools > Extensions. Use the toggle for each extension to turn it off. Restart Chrome and go back to the extensions list. Re-enable the extensions.

How do I use puppeteer to open Chrome?

By default, Puppeteer downloads and uses a specific version of Chromium so its API is guaranteed to work out of the box. To use Puppeteer with a different version of Chrome or Chromium, pass in the executable's path when creating a Browser instance: const browser = await puppeteer.

Why can’t I use Chrome extensions?

Relaunch Chrome and check if you can use the installed extensions. If restarting the browser didn’t work, you can try resetting Chrome: Click the three-dot menu from the top-right corner and select Settings. Scroll down and extend the Advanced settings. Click Restore settings to their original defaults. In the pop-up window, click Reset settings.

How to fix Google Chrome extension manager not working?

Open the Google Chrome menu and click Settings. Scroll down to Advanced > Reset and clean up. Click Clean up computer. Select the Find button. 4. Reset All Experimental Features If you’ve changed some of Chrome’s experimental settings, it’s possible these settings are conflicting with the extension manager.

What is puppeteer?

What is puppeteer ? Puppeteer is a Node library which provides a high-level API to control headless Chrome or Chromium over the DevTools Protocol. You can do all things automatically which you are doing on the browser manually. Create an up-to-date, automated testing environment.

How to reinstall an extension in Google Chrome?

Follow these steps to reinstall an extension in Google Chrome: 1 Open the Chrome menu. 2 Click More tools > Extensions . 3 Click the three-dot menu from the extensions that don’t load. 4 Select Remove from Chrome . 5 Once Chrome uninstalled it, go to the Chrome Web Store and install the same extension.


1 Answers

See the Github thread on this. You'll need to add the following:

  args: [
    '--disable-extensions-except=/path/to/extension/',
    '--load-extension=/path/to/extension/',
  ]

Use the official Puppeteer documentation for more help.

like image 98
jamesfdearborn Avatar answered Nov 07 '22 13:11

jamesfdearborn