aboutsummaryrefslogtreecommitdiffstats
path: root/prevent_focus_ietab.js
diff options
context:
space:
mode:
Diffstat (limited to 'prevent_focus_ietab.js')
-rw-r--r--prevent_focus_ietab.js13
1 files changed, 6 insertions, 7 deletions
diff --git a/prevent_focus_ietab.js b/prevent_focus_ietab.js
index fae6aa1..c4deb1f 100644
--- a/prevent_focus_ietab.js
+++ b/prevent_focus_ietab.js
@@ -12,12 +12,11 @@ This software distribute under term of new BSD style license.
*/
(function() {
-if (gIeTab && gIeTab.onTabSelected) {
- liberator.log("replace IeTab.onTabSelected() function");
- var func = gIeTab.onTabSelected.toSource();
- var newFunc = func.replace(/window\.setTimeout\(gIeTab\.focusIeTab, 0\);/, '');
- gIeTab.removeEventListener("appcontent", "select", gIeTab.onTabSelected);
- gIeTab.addEventListener("appcontent", "select", new Function(newFunc));
-}
+if (!gIeTab || !gIeTab.onTabSelected) return;
+liberator.log("replace IeTab.onTabSelected() function");
+var func = gIeTab.onTabSelected.toSource();
+var newFunc = func.replace(/window\.setTimeout\(gIeTab\.focusIeTab, 0\);/, '');
+gIeTab.removeEventListener("appcontent", "select", gIeTab.onTabSelected);
+gIeTab.addEventListener("appcontent", "select", new Function(newFunc));
})();