mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: for Firefox enable only the required protocol (CDP or BiDi) (#12014)
This commit is contained in:
parent
7ba5529f8d
commit
1eb6a33aa0
@ -43,12 +43,17 @@ export class FirefoxLauncher extends ProductLauncher {
|
|||||||
return {
|
return {
|
||||||
...extraPrefsFirefox,
|
...extraPrefsFirefox,
|
||||||
...(protocol === 'webDriverBiDi'
|
...(protocol === 'webDriverBiDi'
|
||||||
? {}
|
? {
|
||||||
|
// Only enable the WebDriver BiDi protocol
|
||||||
|
'remote.active-protocols': 1,
|
||||||
|
}
|
||||||
: {
|
: {
|
||||||
// Do not close the window when the last tab gets closed
|
// Do not close the window when the last tab gets closed
|
||||||
'browser.tabs.closeWindowWithLastTab': false,
|
'browser.tabs.closeWindowWithLastTab': false,
|
||||||
// Temporarily force disable BFCache in parent (https://bit.ly/bug-1732263)
|
// Temporarily force disable BFCache in parent (https://bit.ly/bug-1732263)
|
||||||
'fission.bfcacheInParent': false,
|
'fission.bfcacheInParent': false,
|
||||||
|
// Only enable the CDP protocol
|
||||||
|
'remote.active-protocols': 2,
|
||||||
}),
|
}),
|
||||||
// Force all web content to use a single content process. TODO: remove
|
// Force all web content to use a single content process. TODO: remove
|
||||||
// this once Firefox supports mouse event dispatch from the main frame
|
// this once Firefox supports mouse event dispatch from the main frame
|
||||||
|
@ -42,7 +42,8 @@ describe('Fixtures', function () {
|
|||||||
expect(dumpioData).toContain('message from dumpio');
|
expect(dumpioData).toContain('message from dumpio');
|
||||||
});
|
});
|
||||||
it('should dump browser process stderr', async () => {
|
it('should dump browser process stderr', async () => {
|
||||||
const {defaultBrowserOptions, puppeteerPath} = await getTestState();
|
const {defaultBrowserOptions, isFirefox, puppeteerPath} =
|
||||||
|
await getTestState();
|
||||||
|
|
||||||
let dumpioData = '';
|
let dumpioData = '';
|
||||||
const options = Object.assign({}, defaultBrowserOptions, {dumpio: true});
|
const options = Object.assign({}, defaultBrowserOptions, {dumpio: true});
|
||||||
@ -57,7 +58,11 @@ describe('Fixtures', function () {
|
|||||||
await new Promise(resolve => {
|
await new Promise(resolve => {
|
||||||
return res.on('close', resolve);
|
return res.on('close', resolve);
|
||||||
});
|
});
|
||||||
|
if (isFirefox && defaultBrowserOptions.protocol === 'webDriverBiDi') {
|
||||||
|
expect(dumpioData).toContain('WebDriver BiDi listening on ws://');
|
||||||
|
} else {
|
||||||
expect(dumpioData).toContain('DevTools listening on ws://');
|
expect(dumpioData).toContain('DevTools listening on ws://');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
it('should close the browser when the node process closes', async () => {
|
it('should close the browser when the node process closes', async () => {
|
||||||
const {defaultBrowserOptions, puppeteerPath, puppeteer} =
|
const {defaultBrowserOptions, puppeteerPath, puppeteer} =
|
||||||
|
Loading…
Reference in New Issue
Block a user