[Pkg-mozext-commits] [tabmixplus] 38/44: [e10s] Make openLinkWithHistory work with remote tab when the url start a download.
David Prévot
taffit at moszumanska.debian.org
Wed Oct 15 02:10:05 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository tabmixplus.
commit fa24d5fc1223773edb19bbd7d0ec84418fa64b3e
Author: onemen <tabmix.onemen at gmail.com>
Date: Sun Oct 12 15:32:59 2014 +0300
[e10s] Make openLinkWithHistory work with remote tab when the url start a download.
---
chrome/content/minit/tablib.js | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/chrome/content/minit/tablib.js b/chrome/content/minit/tablib.js
index 93ad87b..dd0147f 100644
--- a/chrome/content/minit/tablib.js
+++ b/chrome/content/minit/tablib.js
@@ -842,12 +842,21 @@ var tablib = {
}
// we need to update history title after the new page loaded for use in back/forword button
var self = this;
- function updateNewHistoryTitle(aEvent) {
+ function updateNewHistoryTitle() {
try {
- this.removeEventListener("load", updateNewHistoryTitle, true);
- var history = this.webNavigation.sessionHistory;
+ this.removeEventListener("SSTabRestored", updateNewHistoryTitle, true);
+ let browser = this.linkedBrowser;
+ var history = browser.webNavigation.sessionHistory;
var shEntry = history.getEntryAtIndex(history.index, false).QueryInterface(Ci.nsISHEntry);
- shEntry.setTitle(self.getTabForBrowser(this).label);
+ shEntry.setTitle(this.label);
+ } catch (ex) {Tabmix.assert(ex);}
+ }
+ function urlForDownload() {
+ try {
+ this.removeEventListener("SSTabRestored", urlForDownload, true);
+ let browser = this.linkedBrowser;
+ browser.tabmix_allowLoad = true;
+ browser.loadURI(aHref);
} catch (ex) {Tabmix.assert(ex);}
}
try {
@@ -856,8 +865,12 @@ var tablib = {
newTab = this.addTab("about:blank", {dontMove: true});
newTab.linkedBrowser.stop();
if (aHref) {
- addNewHistoryEntry();
- newTab.linkedBrowser.addEventListener("load", updateNewHistoryTitle, true);
+ if (Tabmix.ContentClick.isUrlForDownload(aHref))
+ newTab.addEventListener("SSTabRestored", urlForDownload, true);
+ else {
+ addNewHistoryEntry();
+ newTab.addEventListener("SSTabRestored", updateNewHistoryTitle, true);
+ }
}
tabState.pinned = false;
TabmixSvc.ss.setTabState(newTab, TabmixSvc.JSON.stringify(tabState));
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/tabmixplus.git
More information about the Pkg-mozext-commits
mailing list