Closed Bug 1533682 Opened 6 years ago Closed 6 years ago

Implement basic support for puppeteer's Browser.newPage

Categories

(Remote Protocol :: Agent, enhancement, P1)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 67

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

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");
});
Attached file Bug 1533682 - Implement sessions. (deleted) —

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.

Puppetteer enable all these domains. Implement enable methods in order to prevent it from crashing on that.

Depends on D22695

Blocks: 1533714
Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED
Priority: -- → P1
Pushed by atolfsen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fde0fa0c16da Implement sessions. r=ato https://hg.mozilla.org/integration/autoland/rev/c5edac4ccac9 Implements more Target/Page methods/events to support puppeteer's browser.newPage. r=ato https://hg.mozilla.org/integration/autoland/rev/016f24de0fa3 Implements empty domains used by puppeteer. r=ato
Blocks: 1536794
Blocks: 1548588
Target Milestone: --- → Firefox 67
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: