зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1597259 - [remote] Implement Page.setLifecycleEventsEnabled. r=remote-protocol-reviewers,maja_zf
Differential Revision: https://phabricator.services.mozilla.com/D53826 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
26e6d7493a
Коммит
88538854d7
|
@ -23,12 +23,15 @@ const {
|
|||
class Page extends ContentProcessDomain {
|
||||
constructor(session) {
|
||||
super(session);
|
||||
|
||||
this.enabled = false;
|
||||
this.lifecycleEnabled = false;
|
||||
|
||||
this.onFrameNavigated = this.onFrameNavigated.bind(this);
|
||||
}
|
||||
|
||||
destructor() {
|
||||
this.setLifecycleEventsEnabled({ enabled: false });
|
||||
this.disable();
|
||||
|
||||
super.destructor();
|
||||
|
@ -121,10 +124,22 @@ class Page extends ContentProcessDomain {
|
|||
};
|
||||
}
|
||||
|
||||
setLifecycleEventsEnabled() {}
|
||||
addScriptToEvaluateOnNewDocument() {}
|
||||
createIsolatedWorld() {}
|
||||
|
||||
/**
|
||||
* Controls whether page will emit lifecycle events.
|
||||
*
|
||||
* @param {Object} options
|
||||
* @param {boolean} options.enabled
|
||||
* If true, starts emitting lifecycle events.
|
||||
*/
|
||||
setLifecycleEventsEnabled(options) {
|
||||
const { enabled } = options;
|
||||
|
||||
this.lifecycleEnabled = enabled;
|
||||
}
|
||||
|
||||
url() {
|
||||
return this.content.location.href;
|
||||
}
|
||||
|
@ -158,7 +173,7 @@ class Page extends ContentProcessDomain {
|
|||
break;
|
||||
|
||||
case "pagehide":
|
||||
// Maybe better to bound to "Network.responseReceived" once implemented
|
||||
// Maybe better to bound to "unload" once we can register for this event
|
||||
this.emit("Page.frameStartedLoading", { frameId });
|
||||
break;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче