Closed Bug 1533679 Opened 6 years ago Closed 6 years ago

Support running Puppeteer's connect method against Firefox

Categories

(Remote Protocol :: Agent, enhancement, P1)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ochameau, Assigned: ochameau)

References

Details

Attachments

(10 files)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review

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)

Blocks: 1533682

This is going to help introduce multiple kind of targets.

Depends on D22685

This is going to help have different kind of session par target kind.

Depends on D22686

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

Without that, the exception is silented.

Depends on D22688

Depends on D22689

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

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

Empty methods that are necessary to make puppeteer.connect to pass without throwing.

Depends on D22692

Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED
Priority: -- → P1
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/76ba842e38f5 Document --remote-debugger-port in usage message. r=ato https://hg.mozilla.org/integration/autoland/rev/6e5c72c4c884 Remove unused target argument passed to Domain constructor. r=ato https://hg.mozilla.org/integration/autoland/rev/886ef9f05fa3 Move targets modules to a dedicated targets folder. r=ato https://hg.mozilla.org/integration/autoland/rev/1dc639610f3b Move session modules to a dedicated sessions folder. r=ato https://hg.mozilla.org/integration/autoland/rev/f46ddc90587c Make content process domains to inherit from specialized ContentProcessDomain class. r=ato https://hg.mozilla.org/integration/autoland/rev/600543aa900a Print exceptions thrown by JSON handlers. r=ato https://hg.mozilla.org/integration/autoland/rev/13431774ebec Implement Browser.close. r=ato https://hg.mozilla.org/integration/autoland/rev/735dcab78c93 Implement /json/version. r=ato https://hg.mozilla.org/integration/autoland/rev/44e4bcd29904 Differentiate Sessions and Targets bound to a browser-element from the others. r=ato https://hg.mozilla.org/integration/autoland/rev/ea81ce60cfea Implement very first Target domains. r=ato
Blocks: 1536794
Blocks: 1537770
Blocks: 1549420
Type: enhancement → defect
Type: defect → enhancement
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: