diff options
author | Kris Maglione <maglione.k@gmail.com> | 2011-09-13 15:35:43 -0400 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2011-09-13 15:35:43 -0400 |
commit | 58a465707b03e9ec876efd1a9084c0481dde08ed (patch) | |
tree | ea39ffa0078c3acc03a829e2df187da9800bd242 /common/content | |
parent | 9f4b3ec3a71d4bba1f66ff1f88b776f8dbcd810e (diff) | |
download | pentadactyl-58a465707b03e9ec876efd1a9084c0481dde08ed.tar.gz |
Network state nonsense.
Diffstat (limited to 'common/content')
-rw-r--r-- | common/content/browser.js | 6 | ||||
-rw-r--r-- | common/content/statusline.js | 14 |
2 files changed, 12 insertions, 8 deletions
diff --git a/common/content/browser.js b/common/content/browser.js index cbe82316..c4dc2a8e 100644 --- a/common/content/browser.js +++ b/common/content/browser.js @@ -106,10 +106,10 @@ var Browser = Module("browser", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), onStateChange: util.wrapCallback(function onStateChange(webProgress, request, flags, status) { const L = Ci.nsIWebProgressListener; - if (flags & (L.STATE_IS_DOCUMENT | L.STATE_IS_WINDOW)) { - if (request) - dactyl.applyTriggerObserver("browser.stateChange", arguments); + if (request) + dactyl.applyTriggerObserver("browser.stateChange", arguments); + if (flags & (L.STATE_IS_DOCUMENT | L.STATE_IS_WINDOW)) { // This fires when the load event is initiated // only thrown for the current tab, not when another tab changes if (flags & L.STATE_START) { diff --git a/common/content/statusline.js b/common/content/statusline.js index a4932ac6..c11fbb8d 100644 --- a/common/content/statusline.js +++ b/common/content/statusline.js @@ -140,12 +140,16 @@ var StatusLine = Module("statusline", { webProgress.DOMWindow.document.dactylSecurity = this.security; }, "browser.stateChange": function onStateChange(webProgress, request, flags, status) { - if (flags & Ci.nsIWebProgressListener.STATE_START) - this.progress = 0; - if (flags & Ci.nsIWebProgressListener.STATE_STOP) { - this.progress = ""; + const L = Ci.nsIWebProgressListener; + + if (flags & (L.STATE_IS_DOCUMENT | L.STATE_IS_WINDOW)) + if (flags & L.STATE_START) + this.progress = 0; + else if (flags & L.STATE_STOP) + this.progress = ""; + + if (flags & L.STATE_STOP) this.updateStatus(); - } }, "browser.statusChange": function onStatusChange(webProgress, request, status, message) { this.timeout(function () { |