summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap.js13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/bootstrap.js b/src/bootstrap.js
index 7d4bf8f..162c857 100644
--- a/src/bootstrap.js
+++ b/src/bootstrap.js
@@ -1,5 +1,3 @@
-const PORT = 26001;
-
if (typeof EIB === "undefined")
var EIB = {
headers: {},
@@ -17,7 +15,7 @@ function uninstall() {}
EIB.listen = function () {
this.serverSocket = Cc["@mozilla.org/network/server-socket;1"]
.createInstance(Ci.nsIServerSocket);
- this.serverSocket.init(PORT, true, -1);
+ this.serverSocket.init(26001, true, -1);
const tm = Cc["@mozilla.org/thread-manager;1"].getService();
this.serverSocket.asyncListen({
onSocketAccepted: function (socket, transport) {
@@ -110,7 +108,7 @@ var WindowListener = {
var TrustedReparser = {
observe: function () {
EIB.trusted = EIB.prefs.prefHasUserValue("trusted") ?
- JSON.parse(EIB.prefs.getCharPref("trusted")) :
+ JSON.parse(EIB.prefs.getCharPref("trusted").map(function (v) { return new RegExp(v); }) :
[];
}
};
@@ -145,10 +143,9 @@ function shutdown(data, reason) {
}
function checkTrusted(href) {
- for (var i = 0; i < EIB.trusted.length; i++)
- if (href.indexOf(EIB.trusted[i]) === 0)
- return true;
- return false;
+ return EIB.trusted.some(function (v) {
+ return v.test(href);
+ });
}
function injectCCPEVE(e) {