Permalink
Browse files

bug fix: making sure a window tracker can't regress

  • Loading branch information...
erikvold committed Sep 5, 2011
1 parent b471d35 commit bcd6572046b67e811d2b573f21dc145d4cf2dd71
Showing with 5 additions and 0 deletions.
  1. +5 −0 extension/modules/utils/Scriptish_windowEventTracker.js
@@ -8,6 +8,8 @@ lazyImport(this, "resource://scriptish/logging.js", ["Scriptish_log"]);
lazyUtil(this, "getWindowIDs");
lazyUtil(this, "windowUnloader");
+const events = ["DOMContentLoaded", "load"];
+
const trackers = {};
function Scriptish_windowEventTracker(aWin) {
@@ -16,6 +18,9 @@ function Scriptish_windowEventTracker(aWin) {
trackers[winID] = "start";
aWin.addEventListener("DOMContentLoaded", function() {
+ // if the tracker event gte to this one has occurred then ignore
+ if (~events.indexOf(trackers[winID])) return;
+
trackers[winID] = "DOMContentLoaded";
}, false);
/*

0 comments on commit bcd6572

Please sign in to comment.