Skip to content

Commit

Permalink
fix(launcher): disable component extensions (#4704)
Browse files Browse the repository at this point in the history
Chrome has a set of component extensions - e.g. CryptoTokenExtension
that helps with 2FA.

These extensions are loaded regardless of the `--disable-extensions`
flag we already pass. To disable these extensions, we need to pass additional
`--disable-component-extensions-with-background-pages` flag.

Fix #4300
  • Loading branch information
aslushnikov authored Jul 16, 2019
1 parent f8616ed commit ad18021
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/Launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const DEFAULT_ARGS = [
'--disable-backgrounding-occluded-windows',
'--disable-breakpad',
'--disable-client-side-phishing-detection',
'--disable-component-extensions-with-background-pages',
'--disable-default-apps',
'--disable-dev-shm-usage',
'--disable-extensions',
Expand Down
3 changes: 2 additions & 1 deletion test/assets/simple-extension/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
// Mock script for background extension
// Mock script for background extension
window.MAGIC = 42;
1 change: 1 addition & 0 deletions test/headful.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ module.exports.addTests = function({testRunner, expect, puppeteer, defaultBrowse
const backgroundPageTarget = await waitForBackgroundPageTarget(browserWithExtension);
const page = await backgroundPageTarget.page();
expect(await page.evaluate(() => 2 * 3)).toBe(6);
expect(await page.evaluate(() => window.MAGIC)).toBe(42);
await browserWithExtension.close();
});
it('should have default url when launching browser', async function() {
Expand Down

0 comments on commit ad18021

Please sign in to comment.