mirror of
https://github.com/zotero/zotero.git
synced 2026-09-28 01:31:40 +00:00
Load each preference pane in its own scope
To eliminate conflicts between top-level const/let declarations.
This commit is contained in:
parent
ab5758c0b6
commit
32f812d515
1 changed files with 9 additions and 1 deletions
|
|
@ -95,6 +95,10 @@ var Zotero_Preferences = {
|
|||
let event = new Event('unload');
|
||||
child.dispatchEvent(event);
|
||||
}
|
||||
if (pane.sandbox) {
|
||||
Cu.nukeSandbox(pane.sandbox);
|
||||
pane.sandbox = null;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -276,8 +280,12 @@ var Zotero_Preferences = {
|
|||
await Zotero.Promise.delay();
|
||||
|
||||
if (pane.scripts) {
|
||||
pane.scope = new Cu.Sandbox(window, {
|
||||
sandboxPrototype: window,
|
||||
sandboxName: pane.rawLabel,
|
||||
});
|
||||
for (let script of pane.scripts) {
|
||||
Services.scriptloader.loadSubScript(script, window);
|
||||
Services.scriptloader.loadSubScript(script, pane.scope);
|
||||
}
|
||||
}
|
||||
if (pane.stylesheets) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue