diff options
-rw-r--r-- | chrome/js/browserOverlay.js | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/chrome/js/browserOverlay.js b/chrome/js/browserOverlay.js index 1d3efab..81d19f2 100644 --- a/chrome/js/browserOverlay.js +++ b/chrome/js/browserOverlay.js @@ -2,33 +2,19 @@ Components.utils.import("chrome://redirector/content/js/redirectorprefs.js"); Components.utils.import("chrome://redirector/content/js/redirector.js"); var RedirectorOverlay = { - strings : null, prefs : null, onLoad : function(event) { - try { - - // initialization code - document.getElementById('contentAreaContextMenu') - .addEventListener("popupshowing", function(e) { RedirectorOverlay.showContextMenu(e); }, false); - - this.strings = document.getElementById("redirector-strings"); - this.prefs = new RedirectorPrefs(); - this.changedPrefs(this.prefs); - this.prefs.addListener(this); - document.addEventListener('keypress', function(event) { - if ((event.charCode == 114) && event.altKey) { //alt+r - RedirectorOverlay.toggleEnabled(); - } - }, true); - } catch(e) { - if (this.strings) { - alert(this.strings.getString("initError") + "\n\n" + e); - } else { - alert(e); + this.strings = document.getElementById("redirector-strings"); + this.prefs = new RedirectorPrefs(); + this.changedPrefs(this.prefs); + this.prefs.addListener(this); + document.addEventListener('keypress', function(event) { + if ((event.charCode == 114) && event.altKey) { //alt+r + RedirectorOverlay.toggleEnabled(); } - } + }, true); }, onUnload : function(event) { @@ -37,8 +23,6 @@ var RedirectorOverlay = { }, changedPrefs : function(prefs) { - var button = document.getElementById('redirector-button'); - document.getElementById('redirector-context').hidden = !prefs.showContextMenu; this.refreshUI(); }, @@ -70,5 +54,6 @@ var RedirectorOverlay = { }); } }; + window.addEventListener("load", function(event) { RedirectorOverlay.onLoad(event); }, false); window.addEventListener("unload", function(event) { RedirectorOverlay.onUnload(event); }, false); |