Make sure including include.js multiple times does not break monkey-patching
This is important for plugins that want to monkey-patch interfaces that are only accessible via require() calls
This commit is contained in:
parent
b08f2d829f
commit
a71addb12a
1 changed files with 5 additions and 3 deletions
|
@ -17,9 +17,11 @@ var winName;
|
|||
if (typeof window != 'undefined') {
|
||||
winName = window.name;
|
||||
}
|
||||
Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
|
||||
.getService(Components.interfaces.mozIJSSubScriptLoader)
|
||||
.loadSubScript('resource://zotero/require.js');
|
||||
if (typeof require == "undefined") {
|
||||
Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
|
||||
.getService(Components.interfaces.mozIJSSubScriptLoader)
|
||||
.loadSubScript('resource://zotero/require.js');
|
||||
}
|
||||
|
||||
if (winName) {
|
||||
window.name = winName;
|
||||
|
|
Loading…
Add table
Reference in a new issue