mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1116714
part 1 - Store the document where we added anonomous content so we can call removeAnonymousContent() on it later without throwing. r=pbrosset
This commit is contained in:
parent
42d993decb
commit
ed0d945146
@ -421,6 +421,7 @@ let CustomHighlighterFront = protocol.FrontClass(CustomHighlighterActor, {});
|
|||||||
function CanvasFrameAnonymousContentHelper(tabActor, nodeBuilder) {
|
function CanvasFrameAnonymousContentHelper(tabActor, nodeBuilder) {
|
||||||
this.tabActor = tabActor;
|
this.tabActor = tabActor;
|
||||||
this.nodeBuilder = nodeBuilder;
|
this.nodeBuilder = nodeBuilder;
|
||||||
|
this.anonymousContentDocument = this.tabActor.window.document;
|
||||||
|
|
||||||
this._insert();
|
this._insert();
|
||||||
|
|
||||||
@ -433,11 +434,12 @@ CanvasFrameAnonymousContentHelper.prototype = {
|
|||||||
// If the current window isn't the one the content was inserted into, this
|
// If the current window isn't the one the content was inserted into, this
|
||||||
// will fail, but that's fine.
|
// will fail, but that's fine.
|
||||||
try {
|
try {
|
||||||
let doc = this.tabActor.window.document;
|
let doc = this.anonymousContentDocument;
|
||||||
doc.removeAnonymousContent(this._content);
|
doc.removeAnonymousContent(this._content);
|
||||||
} catch (e) {}
|
} catch (e) {console.log(e)}
|
||||||
events.off(this.tabActor, "navigate", this._onNavigate);
|
events.off(this.tabActor, "navigate", this._onNavigate);
|
||||||
this.tabActor = this.nodeBuilder = this._content = null;
|
this.tabActor = this.nodeBuilder = this._content = null;
|
||||||
|
this.anonymousContentDocument = null;
|
||||||
},
|
},
|
||||||
|
|
||||||
_insert: function() {
|
_insert: function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user