mirror of
https://github.com/zen-browser/components.git
synced 2025-07-07 21:09:58 +02:00
Fixed duplicate actors manager and glance can be disabled now
This commit is contained in:
parent
fb33d61d41
commit
41f178e840
2 changed files with 18 additions and 13 deletions
|
@ -9,7 +9,11 @@ var gZenActorsManager = {
|
|||
return;
|
||||
}
|
||||
|
||||
ChromeUtils.registerWindowActor(...args);
|
||||
this._actors.add(args[0]);
|
||||
try {
|
||||
ChromeUtils.registerWindowActor(...args);
|
||||
this._actors.add(args[0]);
|
||||
} catch (e) {
|
||||
console.warn(`Failed to register JSWindowActor: ${e}`);
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
|
@ -163,18 +163,19 @@
|
|||
|
||||
|
||||
function registerWindowActors() {
|
||||
// TODO: Only if the pref is enabled
|
||||
gZenActorsManager.addJSWindowActor("ZenGlance", {
|
||||
parent: {
|
||||
esModuleURI: "chrome://browser/content/zen-components/actors/ZenGlanceParent.sys.mjs",
|
||||
},
|
||||
child: {
|
||||
esModuleURI: "chrome://browser/content/zen-components/actors/ZenGlanceChild.sys.mjs",
|
||||
events: {
|
||||
DOMContentLoaded: {},
|
||||
if (Services.prefs.getBoolPref("zen.glance.enabled", true)) {
|
||||
gZenActorsManager.addJSWindowActor("ZenGlance", {
|
||||
parent: {
|
||||
esModuleURI: "chrome://browser/content/zen-components/actors/ZenGlanceParent.sys.mjs",
|
||||
},
|
||||
},
|
||||
});
|
||||
child: {
|
||||
esModuleURI: "chrome://browser/content/zen-components/actors/ZenGlanceChild.sys.mjs",
|
||||
events: {
|
||||
DOMContentLoaded: {},
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
registerWindowActors();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue