mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 17:25:36 +00:00
Bug 961798 - Check if this.window is null in BrowserTabActor.prototype._setJavascriptEnabled. r=past
This commit is contained in:
parent
5f0e931495
commit
c03d0c746a
@ -793,22 +793,26 @@ BrowserTabActor.prototype = {
|
||||
let enable = Ci.nsIRequest.LOAD_NORMAL;
|
||||
let disable = Ci.nsIRequest.LOAD_BYPASS_CACHE |
|
||||
Ci.nsIRequest.INHIBIT_CACHING;
|
||||
let docShell = this.window
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDocShell);
|
||||
if (this.window) {
|
||||
let docShell = this.window
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDocShell);
|
||||
|
||||
docShell.defaultLoadFlags = allow ? enable : disable;
|
||||
docShell.defaultLoadFlags = allow ? enable : disable;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Disable or enable JS via docShell.
|
||||
*/
|
||||
_setJavascriptEnabled: function(allow) {
|
||||
let docShell = this.window
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDocShell);
|
||||
if (this.window) {
|
||||
let docShell = this.window
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDocShell);
|
||||
|
||||
docShell.allowJavascript = allow;
|
||||
docShell.allowJavascript = allow;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user