1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 06:17:58 +01:00

Add n_s and n_S.

This commit is contained in:
Kris Maglione
2011-08-11 14:03:17 -04:00
parent ac3f218620
commit c4a40df0b7
6 changed files with 64 additions and 37 deletions

View File

@@ -1297,9 +1297,13 @@ function octal(decimal) parseInt(decimal, 8);
* function.
*
* @param {object} obj
* @param {nsIJSIID} iface The interface to which to query all elements.
* @returns {Generator}
*/
function iter(obj) {
function iter(obj, iface) {
if (arguments.length == 2 && iface instanceof Ci.nsIJSIID)
return iter(obj).map(function (item) item.QueryInterface(iface));
let args = arguments;
let res = Iterator(obj);

View File

@@ -369,19 +369,17 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
prefToArg: function (pref) pref.replace(/.*\./, "").toLowerCase(),
iterCookies: function iterCookies(host) {
for (let c in iter(services.cookies)) {
c.QueryInterface(Ci.nsICookie2);
if (!host || util.isSubdomain(c.rawHost, host) || c.host[0] == "." && c.host.length < host.length && host.indexOf(c.host) == host.length - c.host.length)
for (let c in iter(services.cookies, Ci.nsICookie2))
if (!host || util.isSubdomain(c.rawHost, host) ||
c.host[0] == "." && c.host.length < host.length
&& host.indexOf(c.host) == host.length - c.host.length)
yield c;
}
},
iterPermissions: function iterPermissions(host) {
for (let p in iter(services.permissions)) {
p.QueryInterface(Ci.nsIPermission);
for (let p in iter(services.permissions, Ci.nsIPermission))
if (!host || util.isSubdomain(p.host, host))
yield p;
}
}
}, {
load: function (dactyl, modules, window) {
@@ -390,16 +388,18 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
sanitizer.ranAtShutdown = false;
},
autocommands: function (dactyl, modules, window) {
const { autocommands } = modules;
storage.addObserver("private-mode",
function (key, event, value) {
modules.autocommands.trigger("PrivateMode", { state: value });
autocommands.trigger("PrivateMode", { state: value });
}, window);
storage.addObserver("sanitizer",
function (key, event, value) {
if (event == "domain")
modules.autocommands.trigger("SanitizeDomain", { domain: value });
autocommands.trigger("SanitizeDomain", { domain: value });
else if (!value[1])
modules.autocommands.trigger("Sanitize", { name: event.substr("clear-".length), domain: value[1] });
autocommands.trigger("Sanitize", { name: event.substr("clear-".length), domain: value[1] });
}, window);
},
commands: function (dactyl, modules, window) {