mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
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:
@@ -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();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user