Skip to content

Commit

Permalink
fix: disable OOPIF by default
Browse files Browse the repository at this point in the history
This patch disables OOPIF by default.

**NOTE**: this is a temporary bandaid for the time we're crafting
the full-fledged support for site isolation over DevTools protocol.

References puppeteer#2548.
  • Loading branch information
aslushnikov committed Jun 1, 2018
1 parent 9904da2 commit 7fc1b86
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Launcher.js
Expand Up @@ -38,6 +38,8 @@ const DEFAULT_ARGS = [
'--disable-default-apps',
'--disable-dev-shm-usage',
'--disable-extensions',
//TODO Support OOOPIF. @see https://github.com/GoogleChrome/puppeteer/issues/2548
'--disable-features=site-per-process',
'--disable-hang-monitor',
'--disable-popup-blocking',
'--disable-prompt-on-repost',
Expand Down Expand Up @@ -107,7 +109,6 @@ class Launcher {
if (Array.isArray(options.args))
chromeArguments.push(...options.args);


const usePipe = chromeArguments.includes('--remote-debugging-pipe');
const stdio = ['pipe', 'pipe', 'pipe'];
if (usePipe)
Expand Down
21 changes: 21 additions & 0 deletions test/headful.spec.js
Expand Up @@ -74,6 +74,27 @@ module.exports.addTests = function({testRunner, expect, PROJECT_ROOT, defaultBro
rm(userDataDir);
expect(cookie).toBe('foo=true');
});
it('OOPIF: should report google.com frame', async({server}) => {
// https://google.com is isolated by default in Chromium embedder.
const browser = await puppeteer.launch(headfulOptions);
const page = await browser.newPage();
await page.goto(server.EMPTY_PAGE);
await page.setRequestInterception(true);
page.on('request', r => r.respond({body: 'YO, GOOGLE.COM'}));
await page.evaluate(() => {
const frame = document.createElement('iframe')
frame.setAttribute('name', 'bob')
frame.setAttribute('src', 'https://google.com/')
document.body.appendChild(frame)
});
await page.waitForSelector('iframe[src]');
const urls = page.frames().map(frame => frame.url()).sort();
expect(urls).toEqual([
server.EMPTY_PAGE,
'https://google.com/'
]);
await browser.close();
});
});
};

0 comments on commit 7fc1b86

Please sign in to comment.