mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-23 02:05:42 +00:00
a7f9d31d4c
Puppetteer enable all these domains. Implement enable methods in order to prevent it from crashing on that. Depends on D22695 Differential Revision: https://phabricator.services.mozilla.com/D22696 --HG-- rename : remote/domains/ContentProcessDomains.jsm => remote/domains/content/Emulation.jsm rename : remote/domains/ContentProcessDomains.jsm => remote/domains/content/Network.jsm rename : remote/domains/ContentProcessDomains.jsm => remote/domains/content/Performance.jsm rename : remote/domains/ContentProcessDomains.jsm => remote/domains/content/Runtime.jsm rename : remote/domains/ContentProcessDomains.jsm => remote/domains/content/Security.jsm extra : moz-landing-system : lando
25 lines
650 B
JavaScript
25 lines
650 B
JavaScript
/**
|
|
* To run the server:
|
|
* $ ./mach run --remote-debugging-port=9000 --headless
|
|
* (this requires `ac_add_options --enable-cdp` to be set in your mozconfig)
|
|
*
|
|
* To run the test script:
|
|
* $ npm install puppeteer
|
|
* $ DEBUG="puppeteer:protocol" node puppeteer-demo.js
|
|
*/
|
|
|
|
/* global require */
|
|
|
|
const puppeteer = require("puppeteer");
|
|
|
|
console.log("Calling puppeteer.connect");
|
|
puppeteer.connect({ browserURL: "http://localhost:9000"}).then(async browser => {
|
|
console.log("Connect success!");
|
|
|
|
const page = await browser.newPage();
|
|
console.log("page", !!page);
|
|
await page.goto("https://www.mozilla.org/");
|
|
|
|
return browser.close();
|
|
});
|