From d8023726c5404f65270d9753681476c72bdd82bc Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Fri, 1 Jun 2018 15:20:37 -0700 Subject: [PATCH] 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. --- lib/Launcher.js | 3 ++- test/headful.spec.js | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/lib/Launcher.js b/lib/Launcher.js index 6c191c1d0f614..2723b2cf0e902 100644 --- a/lib/Launcher.js +++ b/lib/Launcher.js @@ -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) diff --git a/test/headful.spec.js b/test/headful.spec.js index 1dc7d3d9e1dd1..f2cb34826ab7b 100644 --- a/test/headful.spec.js +++ b/test/headful.spec.js @@ -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(); + }); }); };