fix: disable OOPIF by default (#2661)
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 #2548.
This commit is contained in:
parent
85d5a3348c
commit
d8023726c5
@ -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',
|
||||
@ -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)
|
||||
|
@ -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();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user