Use global counter for hidden browsers
This commit is contained in:
parent
3c52b422fa
commit
7754d530da
1 changed files with 4 additions and 4 deletions
|
@ -2396,6 +2396,8 @@ Zotero.DragDrop = {
|
||||||
* Functions for creating and destroying hidden browser objects
|
* Functions for creating and destroying hidden browser objects
|
||||||
**/
|
**/
|
||||||
Zotero.Browser = new function() {
|
Zotero.Browser = new function() {
|
||||||
|
var nBrowsers = 0;
|
||||||
|
|
||||||
this.createHiddenBrowser = createHiddenBrowser;
|
this.createHiddenBrowser = createHiddenBrowser;
|
||||||
this.deleteHiddenBrowser = deleteHiddenBrowser;
|
this.deleteHiddenBrowser = deleteHiddenBrowser;
|
||||||
|
|
||||||
|
@ -2423,8 +2425,7 @@ Zotero.Browser = new function() {
|
||||||
hiddenBrowser.docShell.allowJavascript = true;
|
hiddenBrowser.docShell.allowJavascript = true;
|
||||||
hiddenBrowser.docShell.allowMetaRedirects = false;
|
hiddenBrowser.docShell.allowMetaRedirects = false;
|
||||||
hiddenBrowser.docShell.allowPlugins = false;
|
hiddenBrowser.docShell.allowPlugins = false;
|
||||||
Zotero.debug("Created hidden browser ("
|
Zotero.debug("Created hidden browser (" + (nBrowsers++) + ")");
|
||||||
+ (win.document.getElementsByTagName('browser').length - 1) + ")");
|
|
||||||
return hiddenBrowser;
|
return hiddenBrowser;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2436,8 +2437,7 @@ Zotero.Browser = new function() {
|
||||||
myBrowser.destroy();
|
myBrowser.destroy();
|
||||||
myBrowser.parentNode.removeChild(myBrowser);
|
myBrowser.parentNode.removeChild(myBrowser);
|
||||||
myBrowser = null;
|
myBrowser = null;
|
||||||
Zotero.debug("Deleted hidden browser ("
|
Zotero.debug("Deleted hidden browser (" + (--nBrowsers) + ")");
|
||||||
+ (win.document.getElementsByTagName('browser').length - 1) + ")");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue