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.

Load extensions on Windows

See original GitHub issue

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 1.5.0
  • Platform / OS version: Windows 10
  • URLs (if applicable):
  • Node.js version: 9

What steps will reproduce the problem?

Please include code that reproduces the issue.

I needed to load a extension that a page requires, so I added --disable-extensions-except and --load-extension args but it doesn’t load on windows. The full args I passed were:

[ '--enable-logging',
  '--v=1',
  'about:blank',
  '--disable-extensions-except="C:\\Users\\...\\chrome-extensions"',
  '--load-extension="C:\\Users\\...\\chrome-extensions"' ]

And the result was:

---------------------------
Error Loading Extension
---------------------------
Failed to load extension from:
C:\Users\...\...\...\node_modules\puppeteer\.local-chromium\win64-564778\chrome-win32\"C:\Users\...\chrome-extensions". Manifest file is missing or unreadable.
---------------------------
OK
---------------------------

What is the expected result?

Load extensions properly.

What happens instead?

---------------------------
Error Loading Extension
---------------------------
Failed to load extension from:
C:\Users\...\...\...\node_modules\puppeteer\.local-chromium\win64-564778\chrome-win32\"C:\Users\...\chrome-extensions". Manifest file is missing or unreadable.
---------------------------
OK
---------------------------

I think if I pass the extension path as a relative path it might be work but I also think that is so awful.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
mayank2567commented, Mar 16, 2019

I temporary solved this issue by removing --disable-extensions from the default arguments.

but then it does not load any extentions

3reactions
mercertomcommented, Jun 5, 2020

I finally fixed this exact error/issue with ublock. I had originally made several errors. It now works.

  1. I had a typo in my datadir declaration
  2. ublock has nested directories with weird names (I’m not sure this mattered)

Here’s the working code:

	const ublock = '~/Documents/jsprojects/puppeteer-extensions/ublock/';
	const datadir = '~/Documents/jsprojects/chromeprofile/';
	const browser = await puppeteer.launch({
		headless: false,
		userDataDir: datadir,
		defaultViewport: { width:1000, height: 1080 },
		args:
		[
		`--disable-extensions-except=${ublock}`,
		`--load-extension=${ublock}`,
	});

In /puppeteer-extensions/, I changed /chromium.ublock0.152341/ or whatever to plain /ublock/, and deleted a nested sub-directory with an equally funky name. Within /ublock/ there is a manifest.json. Many extensions have multiple layers of weird-named directories. Change the dir names to something simple like /ublock/, and then make sure your line declaring the extension has that directory path typed perfectly in your code.

@Ajju2211 I think you should unzip the extension and absolute/relative path to the directory that contains manifest.json.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Install and Manage Extensions | Microsoft Learn
Installing an extension · Click the Settings button in the top-right > In the left pane, click Extensions. · The Available Extensions tab...
Read more >
How to Add Extensions or Add-ons to Your Browser
Microsoft Edge · In the new window, under Find new extensions, click the Get extensions button in Edge. button. · In the upper-left...
Read more >
Installing a PHP extension on Windows - Manual
On Windows, you have two ways to load a PHP extension: either compile it into PHP, or load the DLL. Loading a pre-compiled...
Read more >
Managing Extensions in Visual Studio Code
To install an extension, select the Install button. Once the installation is complete, the Install button will change to the Manage gear button....
Read more >
How to Install PHP Extensions on Windows? - GeeksforGeeks
Installing PHP Extensions on Windows ... To install PHP extension we need to follow the following steps: Step 1: Click on the Config...
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