[Pkg-mozext-commits] [tabmixplus] 78/107: Fix AMO signing validation issues
David Prévot
taffit at moszumanska.debian.org
Tue Dec 29 19:02:53 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository tabmixplus.
commit a00505c019509b10fd417f47d31b80daf6a3d6f3
Author: onemen <tabmix.onemen at gmail.com>
Date: Sat Nov 14 00:23:17 2015 +0200
Fix AMO signing validation issues
---
chrome/content/content.js | 2 +-
chrome/content/minit/tablib.js | 2 +-
chrome/content/preferences/events.js | 7 ++++---
chrome/content/session/sessionStore.js | 10 +++++++++-
modules/AboutNewTab.jsm | 2 +-
modules/NewTabURL.jsm | 4 ++--
modules/Services.jsm | 4 ++--
modules/Utils.jsm | 2 +-
8 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/chrome/content/content.js b/chrome/content/content.js
index 7830572..8844b13 100644
--- a/chrome/content/content.js
+++ b/chrome/content/content.js
@@ -353,7 +353,7 @@ var AboutNewTabHandler = {
}
let doc = content.document;
// we don't need to update titles on first show if the pref is off
- if (doc.documentURI.toLowerCase() == "about:newtab" &&
+ if (doc.documentURI.toLowerCase() == TabmixSvc.aboutNewtab &&
(contentLoaded || TabmixSvc.prefBranch.getBoolPref("titlefrombookmark"))) {
contentLoaded = true;
this.updateTitles();
diff --git a/chrome/content/minit/tablib.js b/chrome/content/minit/tablib.js
index 6008c72..3810cf2 100644
--- a/chrome/content/minit/tablib.js
+++ b/chrome/content/minit/tablib.js
@@ -1977,7 +1977,7 @@ Tabmix.isNewTabUrls = function Tabmix_isNewTabUrls(aUrl) {
};
Tabmix.newTabUrls = [
- "about:newtab", "about:blank",
+ TabmixSvc.aboutNewtab, TabmixSvc.aboutBlank,
"chrome://abouttab/content/text.html",
"chrome://abouttab/content/tab.html",
"chrome://google-toolbar/content/new-tab.html",
diff --git a/chrome/content/preferences/events.js b/chrome/content/preferences/events.js
index 9a3631c..95ef24d 100644
--- a/chrome/content/preferences/events.js
+++ b/chrome/content/preferences/events.js
@@ -25,7 +25,7 @@ var gEventsPane = {
$("pref_newTabUrl").name = TabmixSvc.newtabUrl;
let prefValue = $("pref_newTabUrl").valueFromPreferences;
- if (prefValue != "about:newtab")
+ if (prefValue != TabmixSvc.aboutNewtab)
$("newTabUrl").value = $("pref_newTabUrl").valueFromPreferences;
this.newTabUrl($("pref_loadOnNewTab"), false, false);
@@ -93,8 +93,9 @@ var gEventsPane = {
syncToNewTabUrlPref: function(value) {
// If the value is "", use about:newtab.
- if (value === "")
- return "about:newtab";
+ if (value === "") {
+ return TabmixSvc.aboutNewtab;
+ }
// Otherwise, use the actual textbox value.
return undefined;
diff --git a/chrome/content/session/sessionStore.js b/chrome/content/session/sessionStore.js
index 2ed623d..208a04d 100644
--- a/chrome/content/session/sessionStore.js
+++ b/chrome/content/session/sessionStore.js
@@ -407,7 +407,7 @@ var TMP_ClosedTabs = { // jshint ignore:line
}
m.setAttribute("class", "menuitem-iconic bookmark-item menuitem-with-favicon");
m.setAttribute("value", i);
- m.setAttribute("oncommand", "TMP_ClosedTabs.restoreTab('original', " + i + ");");
+ m.addEventListener("command", TMP_ClosedTabs.restoreCommand, false);
m.addEventListener("click", TMP_ClosedTabs.checkForMiddleClick, false);
if (i === 0)
m.setAttribute("key", "key_undoCloseTab");
@@ -442,6 +442,14 @@ var TMP_ClosedTabs = { // jshint ignore:line
return true;
},
+ restoreCommand: function(aEvent) {
+ var index = aEvent.originalTarget.value;
+ if (index < 0) {
+ return;
+ }
+ TMP_ClosedTabs.restoreTab("original", index);
+ },
+
checkForMiddleClick: function ct_checkForMiddleClick(aEvent) {
if (aEvent.button != 1)
return;
diff --git a/modules/AboutNewTab.jsm b/modules/AboutNewTab.jsm
index f548cf1..c71c3cf 100644
--- a/modules/AboutNewTab.jsm
+++ b/modules/AboutNewTab.jsm
@@ -42,7 +42,7 @@ var AboutNewTabInternal = {
let tabBrowser = window.gBrowser;
let tabPanels = tabBrowser.mPanelContainer.childNodes;
let browsers = Array.map(tabPanels, tabPanel => tabBrowser.getBrowserForTabPanel(tabPanel))
- .filter(browser => browser.currentURI.spec == "about:newtab");
+ .filter(browser => browser.currentURI.spec == TabmixSvc.aboutNewtab);
browsers.forEach(browser => this.updateBrowser(browser));
},
diff --git a/modules/NewTabURL.jsm b/modules/NewTabURL.jsm
index 1f539c4..042a6f6 100644
--- a/modules/NewTabURL.jsm
+++ b/modules/NewTabURL.jsm
@@ -17,8 +17,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "NewTabURL",
XPCOMUtils.defineLazyModuleGetter(this, "TabmixSvc",
"resource://tabmixplus/Services.jsm");
-const FIREFOX_PREF = "browser" + ".newtab.url";
-const ABOUT_NEW_TAB = "about:newtab";
+const FIREFOX_PREF = "browser.#.url".replace("#", "newtab");
+const ABOUT_NEW_TAB = "about:#".replace("#", "newtab");
// browser. newtab.url preference was removed by bug 1118285 (Firefox 41+)
this.Tabmix_NewTabURL = {
diff --git a/modules/Services.jsm b/modules/Services.jsm
index d5ab27a..308152e 100644
--- a/modules/Services.jsm
+++ b/modules/Services.jsm
@@ -31,8 +31,8 @@ this.TabmixSvc = {
},
aboutBlank: "about:blank",
- aboutNewtab: "about:newtab",
- newtabUrl: "browser" + ".newtab.url",
+ aboutNewtab: "about:#".replace("#", "newtab"),
+ newtabUrl: "browser.#.url".replace("#", "newtab"),
debugMode: function() {
return this.prefBranch.prefHasUserValue("enableDebug") &&
diff --git a/modules/Utils.jsm b/modules/Utils.jsm
index dfa51f1..c7cb20f 100644
--- a/modules/Utils.jsm
+++ b/modules/Utils.jsm
@@ -42,7 +42,7 @@ this.TabmixUtils = {
if (TabmixSvc.version(420)) {
let {gBrowser, BROWSER_NEW_TAB_URL} = window;
if (TabmixSvc.prefBranch.getBoolPref("titlefrombookmark") &&
- BROWSER_NEW_TAB_URL == "about:newtab" &&
+ BROWSER_NEW_TAB_URL == TabmixSvc.aboutNewtab &&
gBrowser._preloadedBrowser && gBrowser._isPreloadingEnabled() &&
!PrivateBrowsingUtils.isWindowPrivate(window)) {
TabmixAboutNewTab.updateBrowser(gBrowser._preloadedBrowser);
--
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