Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

puppeteer-firefox. { ignoreHTTPSErrors: true } triggers Protocol error (Browser.setIgnoreHTTPSErrors) #5076

Closed
Quo0 opened this issue Oct 24, 2019 · 2 comments

Comments

@Quo0
Copy link

Quo0 commented Oct 24, 2019

Steps to reproduce

Tell us about your environment:

  • puppeteer-firefox version: 0.5.0
  • Platform / OS version: Windows 10
  • Node.js version: 8.11.3
  • jest-environment-puppeteer: 4.3.0

What steps will reproduce the problem?
I have faced this issue while using 'jest-environment-puppeteer' package.
The .setup() method in 'jest-environment-puppeteer/lib/PuppeteerEnvironment.js' is trying to .resetBrowser() first by .disconnect() from the existing Browser and .connect() back to it again.

But this issue also occurs when I tried to reproduced this steps manually.
(This issue doesn't occurs when run with Puppeteer version 1.20.0)
Please check the code below:

const URL = 'https://google.com';
const pptrFirefox = require('puppeteer-firefox');

(async () => {
	const initialConfig = {
		headless: false,
		slowMo: 80,
		ignoreHTTPSErrors: true, // false doesn't trigers Protocol error (Browser.setIgnoreHTTPSErrors)
		args: [
			'--window-size=1280,1000',
			'--no-sandbox',
			'--disable-setuid-sandbox',
			'--ignore-certificate-errors',
			'--ignore-certificate-errors-spki-list',
			'--unsafe-eval',
			'--allow-running-insecure-content',
			'--disable-dev-shm-usage',
			'--user-agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36"'
		]
	};
	
	let browser = await pptrFirefox.launch(initialConfig);
	const wsEndpoint = browser.wsEndpoint();

	const newConfig = Object.assign({}, initialConfig, {
		browserURL: undefined,
		browserWSEndpoint: wsEndpoint
	});

	await browser.disconnect();
	browser = await pptrFirefox.connect(newConfig);

	const page = await browser.newPage();
	await page.goto(URL, { waitUntil: 'load' });
	await page.waitFor(5000);
	await browser.close();
})();

What is the expected result?
Puppeteer (Firefox) is running with the { ignoreHTTPSErrors: true } param

What happens instead?
The following error occurs:

`(node:14716) UnhandledPromiseRejectionWarning: Error: Protocol error (Browser.setIgnoreHTTPSErrors): Component returned failure code: 0xc1f30100 (NS_ERROR_FACTORY_EXISTS) [nsIComponentRegistrar.registerFactory] register@chrome://juggler/content/InsecureSweepingOverride.js:60:7
setIgnoreHTTPSErrors@chrome://juggler/content/protocol/BrowserHandler.js:27:7
dispatch@chrome://juggler/content/protocol/Dispatcher.js:182:56
_dispatch@chrome://juggler/content/protocol/Dispatcher.js:102:28
  at Promise (...\tools\puppeteer\node_modules\puppeteer-firefox\lib\Connection.js:74:56)
    at new Promise (<anonymous>)
    at Connection.send (...\tools\puppeteer\node_modules\puppeteer-firefox\lib\Connection.js:73:12)
    at Launcher.connect (...\tools\puppeteer\node_modules\puppeteer-firefox\lib\Launcher.js:222:24)
    at <anonymous>
  -- ASYNC --
    at Puppeteer.<anonymous> (...\tools\puppeteer\node_modules\puppeteer-firefox\lib\helper.js:31:27)
    at ...\tools\puppeteer\direct-connection.js:31:30
    at <anonymous>` 
@Quo0
Copy link
Author

Quo0 commented Jan 7, 2020

Hi, Puppeteer team!
Did you have a chance to take a look at this issue?

@mjzffr
Copy link
Contributor

mjzffr commented Jan 13, 2020

Thanks for the report @Quo0
I'm closing this issue since the experimental puppeteer-firefox package is no longer maintained. A replacement will be available
later this year. You can learn more about Mozilla's work on this at https://wiki.mozilla.org/Remote

See also #5137

@mjzffr mjzffr closed this as completed Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants