Implement basic support for puppeteer's Browser.newPage
Categories
(Remote Protocol :: Agent, enhancement, P1)
Tracking
(Not tracked)
People
(Reporter: ochameau, Assigned: ochameau)
References
(Blocks 4 open bugs)
Details
Attachments
(3 files)
Bug 1533679 is going to help running very basic puppeteer support but that won't help running much useful script as most will want to open a tab with a custom document.
This bug is about support Browser.newTab
which allows opening such custom document. This methods depends on many CDP methods:
- Target.setDiscoverTargets
- Target.createTarget
- Target.attachToTarget
And events: - Target.targetCreated event
- Target.attachedToTarget event
Assignee | ||
Comment 1•6 years ago
|
||
As we don't have any way to run a puppeteer script from mozilla-central, you would have to run a script manually to assert this goal:
- First, run a server:
$ ./mach run --remote-debugging-port=9000 --headless
- Run nodejs script:
$ DEBUG="puppeteer:protocol" node script.js
const puppeteer = require('puppeteer');
puppeteer.connect({ browserURL: "http://localhost:9000"}).then(browser => {
const page = await browser.newPage();
console.log("page", !!page);
console.log("SUCCESS");
});
Assignee | ||
Comment 2•6 years ago
|
||
In order to be able to query/instantiate sub targets like remote frames, or tab targets from the MainProcessTarget,
we have to support session at the protocol layer.
This is all based on a sessionId
attribute put on all inbound/outbound messages.
This patch will be later used, once we start instantiating sub targets.
Assignee | ||
Comment 3•6 years ago
|
||
Depends on D22694
Assignee | ||
Comment 4•6 years ago
|
||
Puppetteer enable all these domains. Implement enable methods in order to prevent it from crashing on that.
Depends on D22695
Updated•6 years ago
|
Comment 6•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/fde0fa0c16da
https://hg.mozilla.org/mozilla-central/rev/c5edac4ccac9
https://hg.mozilla.org/mozilla-central/rev/016f24de0fa3
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Description
•