aboutsummaryrefslogtreecommitdiffstats
path: root/autoIgnoreKey.js
diff options
context:
space:
mode:
Diffstat (limited to 'autoIgnoreKey.js')
-rw-r--r--autoIgnoreKey.js15
1 files changed, 6 insertions, 9 deletions
diff --git a/autoIgnoreKey.js b/autoIgnoreKey.js
index eb48465..8dc4ca1 100644
--- a/autoIgnoreKey.js
+++ b/autoIgnoreKey.js
@@ -39,17 +39,14 @@ const ignorePagesList = window.eval(liberator.globalVariables.autoignorekey_page
.replace(/(?=\*)/g, ".")
+ "$", "i"));
-document.getElementById('appcontent').addEventListener('DOMContentLoaded',function(event){
- var uri = event.target.documentURI;
- liberator.modes.passAllKeys = isMatch(uri);
- //liberator.log('load page: ' + gBrowser.selectedBrowser.contentDocument.URL);
-},false);
+document.getElementById('appcontent').addEventListener('DOMContentLoaded',passAllKeysIfTarget,false);
+getBrowser().mTabBox.addEventListener('TabSelect',passAllKeysIfTarget,false);
-getBrowser().mTabBox.addEventListener('TabSelect',function(event){
- var uri = this.parentNode.currentURI.spec;
+function passAllKeysIfTarget() {
+ var uri = content.document.documentURI;
liberator.modes.passAllKeys = isMatch(uri);
- //liberator.log('select page: ' + gBrowser.selectedBrowser.contentDocument.URL);
-},false);
+ //liberator.log('load page: ' + gBrowser.selectedBrowser.contentDocument.URL);
+}
function isMatch(uri) ignorePagesList.some(function(e) e.test(uri))