Bug 1528036 - Full page screenshot tool is not functional after page refresh r=yulia,jdescottes

Differential Revision: https://phabricator.services.mozilla.com/D33832

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Bryan Kok 2019-07-22 12:04:04 +00:00
Родитель 1c2e5c73ea
Коммит 645a0fa8ca
1 изменённых файлов: 13 добавлений и 0 удалений

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

@ -11,7 +11,20 @@ const { screenshotSpec } = require("devtools/shared/specs/screenshot");
exports.ScreenshotActor = protocol.ActorClassWithSpec(screenshotSpec, {
initialize: function(conn, targetActor) {
protocol.Actor.prototype.initialize.call(this, conn);
this.targetActor = targetActor;
this.document = targetActor.window.document;
this._onNavigate = this._onNavigate.bind(this);
this.targetActor.on("navigate", this._onNavigate);
},
destroy() {
this.targetActor.off("navigate", this._onNavigate);
protocol.Actor.prototype.destroy.call(this);
},
_onNavigate() {
this.document = this.targetActor.window.document;
},
capture: function(args) {