From 174f4ec6362e56b8693db92e022fac5848b80443 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sun, 20 Dec 2015 19:10:52 -0800 Subject: [PATCH] Ugh. --- common/modules/bookmarkcache.jsm | 2 +- common/modules/help.jsm | 2 +- common/modules/protocol.jsm | 6 ++++-- plugins/noscript.js | 18 +++++++++--------- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/common/modules/bookmarkcache.jsm b/common/modules/bookmarkcache.jsm index dcbcb301..eab3bba0 100644 --- a/common/modules/bookmarkcache.jsm +++ b/common/modules/bookmarkcache.jsm @@ -97,7 +97,7 @@ var BookmarkCache = Module("BookmarkCache", XPCOM(Ci.nsINavBookmarkObserver), { let res = {}; for (let bookmark of this) if (bookmark.keyword) - res[bookmark.keyword] = res; + res[bookmark.keyword] = bookmark; return res; }), diff --git a/common/modules/help.jsm b/common/modules/help.jsm index 1c75bda2..8effd1f9 100644 --- a/common/modules/help.jsm +++ b/common/modules/help.jsm @@ -95,7 +95,7 @@ var Help = Module("Help", { update(services["dactyl:"].providers, { "help": Loop((uri, path) => help.files[path]), "help-overlay": Loop((uri, path) => help.overlays[path]), - "help-tag": Loop(function (uri, path) { + "help-tag": Loop((uri, path) => { let tag = decodeURIComponent(path); if (tag in help.files) return RedirectChannel("dactyl://help/" + tag, uri); diff --git a/common/modules/protocol.jsm b/common/modules/protocol.jsm index 53ade751..c363ebff 100644 --- a/common/modules/protocol.jsm +++ b/common/modules/protocol.jsm @@ -153,7 +153,8 @@ ProtocolBase.prototype = { function LocaleChannel(pkg, locale, path, orig) { for (let locale of [locale, "en-US"]) for (let sep of "-/") { - var channel = Channel(["resource:/", pkg + sep + locale, path].join("/"), orig, true, true); + var channel = Channel(["resource:/", pkg + sep + locale, path].join("/"), + orig, true, true); if (channel) return channel; } @@ -163,6 +164,7 @@ function LocaleChannel(pkg, locale, path, orig) { function StringChannel(data, contentType, uri) { let channel = services.StreamChannel(uri); + channel.contentStream = services.CharsetConv("UTF-8").convertToInputStream(data); if (contentType) channel.contentType = contentType; @@ -201,7 +203,7 @@ function XMLChannel(uri, contentType, noErrorChannel, unprivileged) { let [, pre, doctype, url, extra, open, post] = util.regexp(String.raw` ^ ([^]*?) (?: - (\s]|\s[^[])*)) + (\s]|\s[^[])*)) (\s+ \[)? ([^]*) )? diff --git a/plugins/noscript.js b/plugins/noscript.js index 4853a54a..eae208de 100755 --- a/plugins/noscript.js +++ b/plugins/noscript.js @@ -22,7 +22,7 @@ function getSites() { const ns = services.noscript; const global = options["script"]; const groups = { allowed: ns.jsPolicySites, temp: ns.tempSites, untrusted: ns.untrustedSites }; - const show = RealSet(options["noscript-list"]); + const show = new RealSet(options["noscript-list"]); const sites = window.noscriptOverlay.getSites(); const blockUntrusted = global && ns.alwaysBlockUntrustedContent; @@ -76,7 +76,7 @@ function getSites() { res = res.concat(ary); } - let seen = RealSet(); + let seen = new RealSet(); return res.filter(function (h) { let res = !seen.has(h); seen.add(h); @@ -100,7 +100,7 @@ function getObjects() { if (sites.some(s => s == host)) specific.push(filter); } - let seen = RealSet(); + let seen = new RealSet(); return specific.concat(general).filter(function (site) { let res = !seen.has(site); seen.add(site); @@ -292,25 +292,25 @@ group.options.add(["script"], has: (val) => hasOwnProperty(services.noscript.jsPolicySites.sitesMap, val) && !hasOwnProperty(services.noscript.tempSites.sitesMap, val), get set() { - return RealSet(k for (k in services.noscript.jsPolicySites.sitesMap)) - .difference(RealSet(k for (k in services.noscript.tempSites.sitesMap))) + return new RealSet(k for (k in services.noscript.jsPolicySites.sitesMap)) + .difference(new RealSet(k for (k in services.noscript.tempSites.sitesMap))) } }, { names: ["noscript-tempsites", "nst"], description: "The list of sites temporarily allowed to execute scripts", action: (add, sites) => sites.length && noscriptOverlay.safeAllow(sites, add, true, -1), completer: (context) => completion.noscriptSites(context), - get set() { return RealSet(k for (k in services.noscript.tempSites.sitesMap)) }, + get set() { return new RealSet(k for (k in services.noscript.tempSites.sitesMap)) }, }, { names: ["noscript-untrusted", "nsu"], description: "The list of untrusted sites", action: (add, sites) => sites.length && services.noscript.setUntrusted(sites, add), completer: (context) => completion.noscriptSites(context), - get set() { return RealSet(k for (k in services.noscript.untrustedSites.sitesMap)) }, + get set() { return new RealSet(k for (k in services.noscript.untrustedSites.sitesMap)) }, }, { names: ["noscript-objects", "nso"], description: "The list of allowed objects", - get set() { return RealSet(array.flatten( + get set() { return new RealSet(array.flatten( [Array.concat(v).map(function (v) { return v + "@" + this; }, k) for ([k, v] of iter(services.noscript.objectWhitelist))])) }, action: function (add, patterns) { @@ -354,7 +354,7 @@ group.options.add(["script"], initialValue: true, getter: params.getter || (() => Array.from(params.set)), setter: function (values) { - let newset = RealSet(values); + let newset = new RealSet(values); let current = params.set; let value = this.value; params.action(true, values.filter(site => !current.has(site)))