Fix running function passed to Zotero.openInViewer()
This fixes plugin removal in the Add-ons window.
Broken by b8966f7878
This commit is contained in:
parent
e7fa5d7f9d
commit
75aa17f169
1 changed files with 6 additions and 2 deletions
|
@ -1127,8 +1127,12 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
|
|||
let browser
|
||||
let func = function () {
|
||||
win.removeEventListener("load", func);
|
||||
browser = win.document.documentElement.getElementsByTagName('browser')[0];
|
||||
browser.addEventListener("pageshow", innerFunc);
|
||||
// <browser> is created in basicViewer.js in a window load event, so we have to
|
||||
// wait for that
|
||||
setTimeout(() => {
|
||||
browser = win.document.documentElement.getElementsByTagName('browser')[0];
|
||||
browser.addEventListener("pageshow", innerFunc);
|
||||
});
|
||||
};
|
||||
let innerFunc = function () {
|
||||
browser.removeEventListener("pageshow", innerFunc);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue