diff --git a/chrome/content/tabutils-pt.js b/chrome/content/tabutils-pt.js index 271d80d..7cb6dc3 100644 --- a/chrome/content/tabutils-pt.js +++ b/chrome/content/tabutils-pt.js @@ -57,8 +57,8 @@ tabutils._phantomTabs = function() { } if (!aRestoring) { - tabutils._ss.setTabValue(aTab, "pinned", true); - tabutils._ss.setTabValue(aTab, "bookmarkId", aTab.bookmarkId); + tabutils._ss.setTabValue(aTab, "pinned", "true"); + tabutils._ss.setTabValue(aTab, "bookmarkId", String(aTab.bookmarkId || "")); // Bug 961646 } aTab.dispatchEvent(new CustomEvent("TabPinning", {bubbles: true})); diff --git a/chrome/content/tabutils.js b/chrome/content/tabutils.js index d93dea4..cb83129 100644 --- a/chrome/content/tabutils.js +++ b/chrome/content/tabutils.js @@ -587,6 +587,34 @@ tabutils._tabOpeningOptions = function() { } }); + let tmp = {}; + Cu.import("resource://gre/modules/DownloadLastDir.jsm", tmp); + + if (tmp.DownloadLastDir && // Bug 722995 [Fx19] + tmp.DownloadLastDir.prototype.getFileAsync && // Bug 854299 [Fx23] + tmp.DownloadLastDir.prototype.getFileAsync.name != "TU_getFileAsync") + tmp.DownloadLastDir.prototype.getFileAsync = (function() { + let getFileAsync = tmp.DownloadLastDir.prototype.getFileAsync; + return function TU_getFileAsync(aURI, aCallback) { + let win = this.window; + if (win._closeTimer) { + win.clearTimeout(win._closeTimer); + win._closeTimer = null; + + aCallback = (function() { + let lastDirCallback = aCallback; + return function TU_LastDirCallback(lastDir) { + lastDirCallback(lastDir); + if (!win.closed) { + win.setTimeout(win.close, 250); + } + }; + })(); + } + getFileAsync.apply(this, arguments); + }; + })(); + //在当前标签页的右侧打开新标签页 //连续打开后台标签时保持原有顺序 TU_hookCode("gBrowser.addTab", diff --git a/chrome/content/unknownContentType.xul b/chrome/content/unknownContentType.xul index aceb7b0..f342b13 100644 --- a/chrome/content/unknownContentType.xul +++ b/chrome/content/unknownContentType.xul @@ -1,62 +1,14 @@ -