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

fix: disable OOPIF by default #2661

Merged
merged 4 commits into from Jun 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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('src', 'https://google.com/');
document.body.appendChild(frame);
return new Promise(x => frame.onload = x);
});
await page.waitForSelector('iframe[src="https://google.com/"]');
const urls = page.frames().map(frame => frame.url()).sort();
expect(urls).toEqual([
server.EMPTY_PAGE,
'https://google.com/'
]);
await browser.close();
});
});
};