Support running Puppeteer's connect method against Firefox
Categories
(Remote Protocol :: Agent, enhancement, P1)
Tracking
(Not tracked)
People
(Reporter: ochameau, Assigned: ochameau)
References
(Blocks 2 open bugs)
Details
Attachments
(10 files)
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details |
The minimal CDP server to be landed in bug 1523104, will support very basic features in order to enable basic usages of chrome-remote-interface client library.
This is demonstrated by the following test: remote/test/browser/browser_cdp.js
But we are lacking support of /json/version and a couple of methods on Target domain (Target.getBrowserContexts and Target.setDiscoverTargets) in order to allow puppeteer.connnect()
function to work.
We do not have any infra to run puppeteer script/test from mozilla-central,
so the only way to evaluate this support is to manually run a puppeteer nodejs script, like this:
- 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 => {
console.log("SUCCESS");
});
(Note that you will need ac_add_options --enable-cdp
to be set in your mozconfig
and also note that this works with artifact builds)
Assignee | ||
Comment 1•6 years ago
|
||
Assignee | ||
Comment 2•6 years ago
|
||
Depends on D22684
Assignee | ||
Comment 3•6 years ago
|
||
This is going to help introduce multiple kind of targets.
Depends on D22685
Assignee | ||
Comment 4•6 years ago
|
||
This is going to help have different kind of session par target kind.
Depends on D22686
Assignee | ||
Comment 5•6 years ago
|
||
Remove content, docShell and chromeEventHandler attribute from base Domain class
as these fields only work for domains implemented in the content process and
attached to a browsing context/document.
For "global" domains like Target or Browser, that are not bound to any document,
these properties won't work.
Depends on D22687
Assignee | ||
Comment 6•6 years ago
|
||
Without that, the exception is silented.
Depends on D22688
Assignee | ||
Comment 7•6 years ago
|
||
Depends on D22689
Assignee | ||
Comment 8•6 years ago
|
||
Introduces a new kind of target "main-process",
which is not bound to any particular browser-element/browsing-context.
This implements only a subtest of domains and typical won't support the "content" ones.
This will require some more work in order to acknowledge having multiple kinds of targets.
We will also have "worker", "addon" and remoted-frames which will be very similar to tabs.
Depends on D22690
Assignee | ||
Comment 9•6 years ago
|
||
The Session used by MainProcessTarget isn't bound to any browser-element
and so do not use any of the message manager to pipe message to the content process.
Same for Target, the MainProcessTarget doesn't expose any browsing-context-related attribute.
Depends on D22691
Assignee | ||
Comment 10•6 years ago
|
||
Empty methods that are necessary to make puppeteer.connect to pass without throwing.
Depends on D22692
Updated•6 years ago
|
Comment 11•6 years ago
|
||
Comment 12•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/76ba842e38f5
https://hg.mozilla.org/mozilla-central/rev/6e5c72c4c884
https://hg.mozilla.org/mozilla-central/rev/886ef9f05fa3
https://hg.mozilla.org/mozilla-central/rev/1dc639610f3b
https://hg.mozilla.org/mozilla-central/rev/f46ddc90587c
https://hg.mozilla.org/mozilla-central/rev/600543aa900a
https://hg.mozilla.org/mozilla-central/rev/13431774ebec
https://hg.mozilla.org/mozilla-central/rev/735dcab78c93
https://hg.mozilla.org/mozilla-central/rev/44e4bcd29904
https://hg.mozilla.org/mozilla-central/rev/ea81ce60cfea
Updated•6 years ago
|
Description
•