Bug 961798 - Check if this.window is null in BrowserTabActor.prototype._setJavascriptEnabled. r=past

This commit is contained in:
Peiyong Lin 2014-01-21 09:55:00 +02:00
parent 5f0e931495
commit c03d0c746a

View File

@ -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;
}
},
/**