Bug 1441810 - Ensure session save/restore works even if no ContentDelegate is set. r=jchen

This commit is contained in:
Dylan Roeh 2018-04-25 09:39:52 -05:00
Родитель f9c00d1336
Коммит d9f21c82b4
2 изменённых файлов: 9 добавлений и 6 удалений

Просмотреть файл

@ -41,11 +41,6 @@ class GeckoViewContent extends GeckoViewContentModule {
this);
this.messageManager.addMessageListener("GeckoView:ZoomToInput",
this);
this.progressFilter =
Cc["@mozilla.org/appshell/component/browser-status-filter;1"]
.createInstance(Ci.nsIWebProgress);
this.flags = Ci.nsIWebProgress.NOTIFY_LOCATION;
}
onDisable() {
@ -206,6 +201,13 @@ class GeckoViewContent extends GeckoViewContentModule {
addEventListener("load", this, {capture: true, mozSystemGroup: true, once: true});
addEventListener("pageshow", this, {capture: true, mozSystemGroup: true, once: true});
if (!this.progressFilter) {
this.progressFilter =
Cc["@mozilla.org/appshell/component/browser-status-filter;1"]
.createInstance(Ci.nsIWebProgress);
this.flags = Ci.nsIWebProgress.NOTIFY_LOCATION;
}
this.progressFilter.addProgressListener(this, this.flags);
let webProgress = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebProgress);

Просмотреть файл

@ -16,6 +16,8 @@ class GeckoViewContent extends GeckoViewModule {
"GeckoView:SaveState",
"GeckoView:RestoreState"
]);
this.messageManager.addMessageListener("GeckoView:SaveStateFinish", this);
}
onEnable() {
@ -33,7 +35,6 @@ class GeckoViewContent extends GeckoViewModule {
this.messageManager.addMessageListener("GeckoView:DOMFullscreenExit", this);
this.messageManager.addMessageListener("GeckoView:DOMFullscreenRequest", this);
this.messageManager.addMessageListener("GeckoView:SaveStateFinish", this);
}
onDisable() {