Index: lib/whitelisting.js |
=================================================================== |
--- a/lib/whitelisting.js |
+++ b/lib/whitelisting.js |
@@ -123,17 +123,17 @@ |
exports.getKey = (page, frame) => |
{ |
let keys = sitekeys.get(page); |
if (!keys) |
return null; |
for (; frame != null; frame = frame.parent) |
{ |
- let key = keys[stringifyURL(frame.url)]; |
+ let key = keys.get(stringifyURL(frame.url)); |
if (key) |
return key; |
} |
return null; |
}; |
function checkKey(token, url) |
@@ -153,20 +153,20 @@ |
return key; |
} |
function recordKey(key, page, url) |
{ |
let keys = sitekeys.get(page); |
if (!keys) |
{ |
- keys = Object.create(null); |
+ keys = new Map(); |
sitekeys.set(page, keys); |
} |
- keys[stringifyURL(url)] = key; |
+ keys.set(stringifyURL(url), key); |
} |
port.on("filters.addKey", (message, sender) => |
{ |
let key = checkKey(message.token, sender.frame.url); |
if (key) |
recordKey(key, sender.page, sender.frame.url); |
}); |