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
|
||||
**/
|
||||
Zotero.Browser = new function() {
|
||||
var nBrowsers = 0;
|
||||
|
||||
this.createHiddenBrowser = createHiddenBrowser;
|
||||
this.deleteHiddenBrowser = deleteHiddenBrowser;
|
||||
|
||||
|
@ -2423,8 +2425,7 @@ Zotero.Browser = new function() {
|
|||
hiddenBrowser.docShell.allowJavascript = true;
|
||||
hiddenBrowser.docShell.allowMetaRedirects = false;
|
||||
hiddenBrowser.docShell.allowPlugins = false;
|
||||
Zotero.debug("Created hidden browser ("
|
||||
+ (win.document.getElementsByTagName('browser').length - 1) + ")");
|
||||
Zotero.debug("Created hidden browser (" + (nBrowsers++) + ")");
|
||||
return hiddenBrowser;
|
||||
}
|
||||
|
||||
|
@ -2436,8 +2437,7 @@ Zotero.Browser = new function() {
|
|||
myBrowser.destroy();
|
||||
myBrowser.parentNode.removeChild(myBrowser);
|
||||
myBrowser = null;
|
||||
Zotero.debug("Deleted hidden browser ("
|
||||
+ (win.document.getElementsByTagName('browser').length - 1) + ")");
|
||||
Zotero.debug("Deleted hidden browser (" + (--nBrowsers) + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue