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

[PWPBM] Make Personas work in private windows.

This commit is contained in:
Kris Maglione
2013-04-26 21:09:23 -07:00
parent a06e8f278d
commit 6b84489489
3 changed files with 28 additions and 3 deletions

View File

@@ -1877,6 +1877,27 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
userContext.DOM = Class("DOM", DOM, { init: function DOM_(sel, ctxt) DOM(sel, ctxt || buffer.focusedFrame.document) });
userContext.$ = modules.userContext.DOM;
// Hack: disable disabling of Personas in private windows.
let root = document.documentElement;
if (PrivateBrowsingUtils && PrivateBrowsingUtils.isWindowPrivate(window)
&& root._lightweightTheme
&& root._lightweightTheme._lastScreenWidth == null) {
let { isWindowPrivate } = PrivateBrowsingUtils;
try {
PrivateBrowsingUtils.isWindowPrivate = function () false;
let { LightweightThemeConsumer } = Cu.import("resource://gre/modules/LightweightThemeConsumer.jsm", {});
LightweightThemeConsumer.call(root._lightweightTheme, document);
}
catch (e) {
util.reportError(e);
}
finally {
PrivateBrowsingUtils.isWindowPrivate = isWindowPrivate;
}
}
dactyl.timeout(function () {
try {
var args = config.prefs.get("commandline-args")