Index: lib/typoFixer.js |
=================================================================== |
--- a/lib/typoFixer.js |
+++ b/lib/typoFixer.js |
@@ -27,47 +27,47 @@ let netError = require("typoNetError"); |
let typoWindowObserver = null; |
exports.attachWindowObserver = attachWindowObserver; |
function attachWindowObserver() |
{ |
if (typoWindowObserver) |
return; |
- |
+ |
// Attach our handlers to all browser windows |
typoWindowObserver = new WindowObserver( |
{ |
applyToWindow: function(window) |
{ |
if (!appIntegration.isKnownWindow(window)) |
return; |
- |
+ |
netError.applyToWindow(window); |
appIntegration.applyToWindow(window, correctURL); |
}, |
removeFromWindow: function(window) |
{ |
if (!appIntegration.isKnownWindow(window)) |
return; |
- |
+ |
netError.removeFromWindow(window); |
appIntegration.removeFromWindow(window); |
} |
}); |
} |
attachWindowObserver(); |
exports.detachWindowObserver = detachWindowObserver; |
function detachWindowObserver() |
{ |
if (!typoWindowObserver) |
return; |
- |
+ |
// Detach our handlers from all browser windows |
typoWindowObserver.shutdown(); |
typoWindowObserver = null; |
} |
function parseURL(url) |
{ |
if (/^\s*((?:\w+:)?\/*(?:[^\/#]*@)?)([^\/:#]*)/.test(url)) |
@@ -169,35 +169,35 @@ function correctURL(window, value) |
suffix += anchor; |
} |
} |
} |
if (!hasCorrection) |
return null; |
- |
+ |
if (!appIntegration.isTypoCorrectionEnabled(window, prefix, domain, suffix)) |
return null; |
// Show infobar to inform and ask about correction |
let [message, yes, no] = getInfobarTexts(); |
message = message.replace(/\?1\?/g, prefix+domain); |
let buttons = [ |
{ |
label: yes, |
- accessKey: null, |
+ accessKey: "", |
callback: function() |
{ |
// Yes: Do nothing |
} |
}, |
{ |
label: no, |
- accessKey: null, |
+ accessKey: "", |
callback: function() |
{ |
// No: Add to list of corrections (ignore) |
let entry = oldDomain.replace(/^www\./, ""); |
Prefs.whitelist[entry] = true; |
onWhitelistEntryAdded(entry); |
Prefs.whitelist = JSON.parse(JSON.stringify(Prefs.whitelist)); |