diff options
author | Gaming4JC <g4jc@bulletmail.org> | 2018-11-02 23:03:17 -0400 |
---|---|---|
committer | Gaming4JC <g4jc@bulletmail.org> | 2018-11-02 23:03:17 -0400 |
commit | 937fb6e24af2f521a5f53d9709634891368cc235 (patch) | |
tree | 20362ce32ae27148a3da5bc128828197b5ee5b10 | |
parent | 80e50e1b3f42577f8526c0fa9b31877b6ae21285 (diff) | |
download | iceweasel-uxp-937fb6e24af2f521a5f53d9709634891368cc235.tar.gz |
backport m-c 1376892: Don't show the stop button for local url loads
-rwxr-xr-x | base/content/browser.js | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/base/content/browser.js b/base/content/browser.js index 257c398..1f1620c 100755 --- a/base/content/browser.js +++ b/base/content/browser.js @@ -4148,7 +4148,7 @@ var XULBrowserWindow = { // XXX: This needs to be based on window activity... this.stopCommand.removeAttribute("disabled"); - CombinedStopReload.switchToStop(); + CombinedStopReload.switchToStop(aRequest); } } else if (aStateFlags & nsIWebProgressListener.STATE_STOP) { @@ -4203,7 +4203,7 @@ var XULBrowserWindow = { this._busyUI = false; this.stopCommand.setAttribute("disabled", "true"); - CombinedStopReload.switchToReload(aRequest instanceof Ci.nsIRequest); + CombinedStopReload.switchToReload(aRequest); } } }, @@ -4496,16 +4496,17 @@ var CombinedStopReload = { this._stopClicked = true; }, - switchToStop: function () { - if (!this._initialized) + switchToStop: function (aRequest) { + if (!this._initialized || !this._shouldSwitch(aRequest)) return; this._cancelTransition(); this.reload.setAttribute("displaystop", "true"); }, - switchToReload: function (aDelay) { - if (!this._initialized) + switchToReload: function (aRequest, aDelay) { + if (!this._initialized || !this._shouldSwitch(aRequest) || + !this.reload.hasAttribute("displaystop")) return; this.reload.removeAttribute("displaystop"); @@ -4531,6 +4532,19 @@ var CombinedStopReload = { }, 650, this); }, + _shouldSwitch(aRequest) { + if (!aRequest || + !aRequest.originalURI || + aRequest.originalURI.spec.startsWith("about:reader")) + return true; + + if (aRequest.originalURI.schemeIs("chrome") || + aRequest.originalURI.schemeIs("about")) + return false; + + return true; + }, + _cancelTransition: function () { if (this._timer) { clearTimeout(this._timer); |