1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-04 22:45:46 +01:00

Update for per-window PBM changes. Closes issue #948.

--HG--
extra : rebase_source : b66c01ca37ebd724b00e454a1ca3b9df32d6937a
This commit is contained in:
Kris Maglione
2013-03-04 19:28:27 -08:00
parent 978abae9f7
commit f5049bbb5e
2 changed files with 44 additions and 12 deletions

View File

@@ -290,12 +290,25 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
}
},
getContext: function getContext(thing) {
if (!Ci.nsILoadContext)
return null;
if (thing instanceof Ci.nsIDOMNode)
thing = thing.ownerDocument;
if (thing instanceof Ci.nsIDOMDocument)
thing = thing.defaultView;
if (thing instanceof Ci.nsIInterfaceRequestor)
thing = thing.getInterface(Ci.nsIWebNavigation);
return thing.QueryInterface(Ci.nsILoadContext);
},
get ranAtShutdown() config.prefs.get("didSanitizeOnShutdown"),
set ranAtShutdown(val) config.prefs.set("didSanitizeOnShutdown", Boolean(val)),
get runAtShutdown() prefs.get("privacy.sanitize.sanitizeOnShutdown"),
set runAtShutdown(val) prefs.set("privacy.sanitize.sanitizeOnShutdown", Boolean(val)),
sanitize: function (items, range)
sanitize: function sanitize(items, range)
this.withSavedValues(["sanitizing"], function () {
this.sanitizing = true;
let errors = this.sanitizeItems(items, range, null);
@@ -319,7 +332,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
return errors;
}),
sanitizeItems: function (items, range, host, key)
sanitizeItems: function sanitizeItems(items, range, host, key)
this.withSavedValues(["sanitizing"], function () {
this.sanitizing = true;
if (items == null)