aboutsummaryrefslogtreecommitdiff
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/js/browserOverlay.js2
-rw-r--r--chrome/js/redirect.js13
-rw-r--r--chrome/js/redirector.js5
-rw-r--r--chrome/redirector.html1
4 files changed, 10 insertions, 11 deletions
diff --git a/chrome/js/browserOverlay.js b/chrome/js/browserOverlay.js
index ed1ab73..019505f 100644
--- a/chrome/js/browserOverlay.js
+++ b/chrome/js/browserOverlay.js
@@ -18,7 +18,7 @@ var RedirectorOverlay = {
this.changedPrefs(this.prefs);
this.prefs.addListener(this);
document.addEventListener('keypress', function(event) {
- if ((event.charCode == 114) && event.altKey) { //alt+r
+ if ((RedirectorOverlay.prefs.enableShortcutKey) && (event.charCode == 114) && event.altKey) { //alt+r
RedirectorOverlay.toggleEnabled();
}
}, true);
diff --git a/chrome/js/redirect.js b/chrome/js/redirect.js
index 4a05ef8..eab14f8 100644
--- a/chrome/js/redirect.js
+++ b/chrome/js/redirect.js
@@ -202,11 +202,14 @@ Redirect.prototype = {
}
var resultUrl = this.redirectUrl;
for (var i = 1; i < matches.length; i++) {
- resultUrl = resultUrl.replace(new RegExp('\\$' + i, 'gi'),
- this.unescapeMatches ? unescape(matches[i]) :
- this.escapeMatches ? encodeURIComponent(matches[i]) :
- matches[i]
- );
+ var repl = matches[i] || '';
+ if (this.unescapeMatches) {
+ repl = unescape(repl);
+ }
+ if (this.escapeMatches) {
+ repl = encodeURIComponent(repl);
+ }
+ resultUrl = resultUrl.replace(new RegExp('\\$' + i, 'gi'), repl);
}
this._rxInclude.lastIndex = 0;
return resultUrl;
diff --git a/chrome/js/redirector.js b/chrome/js/redirector.js
index 78974bd..86e07a2 100644
--- a/chrome/js/redirector.js
+++ b/chrome/js/redirector.js
@@ -303,11 +303,6 @@ Redirector = {
if (redirectsFile.exists()) {
this.importRedirects(redirectsFile);
}
-
- //RedirectorProxy.start(this._prefs.proxyServerPort);
- //Redirector.debug('Registering as Proxy Filter');
- //var pps = Cc["@mozilla.org/network/protocol-proxy-service;1"].getService(Ci.nsIProtocolProxyService);
- //pps.registerFilter(this, 0);
},
_loadStrings : function() {
diff --git a/chrome/redirector.html b/chrome/redirector.html
index 68300c1..eb0baa7 100644
--- a/chrome/redirector.html
+++ b/chrome/redirector.html
@@ -31,6 +31,7 @@
<input type="checkbox" id="enable-redirector" data-pref="enabled" /><label>Enabled</label><br />
<input type="checkbox" id="show-status-bar-icon" data-pref="showStatusBarIcon"/><label>Statusbar icon</label><br />
<input type="checkbox" id="show-context-menu" data-pref="showContextMenu"/><label>Context menu</label><br />
+ <input type="checkbox" id="enable-shortcut-key" data-pref="enableShortcutKey"/><label>Enable/Disable via Alt-r</label><br />
<input type="checkbox" id="enable-debug-output" data-pref="debugEnabled"/><label>Debug output</label><br />
<div class="button-row">
<button id="close">Close</button>