mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix(firefox): enable domains in a proper order (#4077)
Otherwise we might get console messages from Page domain before we get execution contexts reported.
This commit is contained in:
parent
9ef23b1754
commit
dae998ec06
@ -27,9 +27,9 @@ class Page extends EventEmitter {
|
|||||||
static async create(session, target, defaultViewport) {
|
static async create(session, target, defaultViewport) {
|
||||||
const page = new Page(session, target);
|
const page = new Page(session, target);
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
session.send('Page.enable'),
|
|
||||||
session.send('Network.enable'),
|
|
||||||
session.send('Runtime.enable'),
|
session.send('Runtime.enable'),
|
||||||
|
session.send('Network.enable'),
|
||||||
|
session.send('Page.enable'),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (defaultViewport)
|
if (defaultViewport)
|
||||||
@ -729,9 +729,6 @@ class Page extends EventEmitter {
|
|||||||
return await this._frameManager.mainFrame().setContent(html);
|
return await this._frameManager.mainFrame().setContent(html);
|
||||||
}
|
}
|
||||||
|
|
||||||
_onClosed() {
|
|
||||||
}
|
|
||||||
|
|
||||||
_onConsole({type, args, executionContextId, location}) {
|
_onConsole({type, args, executionContextId, location}) {
|
||||||
const context = this._frameManager.executionContextById(executionContextId);
|
const context = this._frameManager.executionContextById(executionContextId);
|
||||||
this.emit(Events.Page.Console, new ConsoleMessage(type, args.map(arg => createHandle(context, arg)), location));
|
this.emit(Events.Page.Console, new ConsoleMessage(type, args.map(arg => createHandle(context, arg)), location));
|
||||||
|
Loading…
Reference in New Issue
Block a user