[Pkg-mozext-commits] [tabmixplus] 08/13: Update compatibility with Pale Moon 25, change isVersion to return false if Pale Moon version is 25+ and the caller function did not pass a version number
David Prévot
taffit at moszumanska.debian.org
Wed Oct 29 01:34:31 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 25e5548e9c299588f49346d939bbca59094ab31a
Author: onemen <tabmix.onemen at gmail.com>
Date: Thu Oct 23 15:40:57 2014 +0300
Update compatibility with Pale Moon 25, change isVersion to return false if Pale Moon version is 25+ and the caller function did not pass a version number
---
chrome/content/links/setup.js | 2 +-
chrome/content/minit/minit.js | 2 +-
chrome/content/session/session.js | 2 +-
chrome/content/session/sessionStore.js | 4 ++--
chrome/content/utils.js | 4 ++--
install.rdf | 5 +++++
modules/Services.jsm | 17 ++++++++++++++---
7 files changed, 26 insertions(+), 10 deletions(-)
diff --git a/chrome/content/links/setup.js b/chrome/content/links/setup.js
index 6d32282..f41f4b6 100644
--- a/chrome/content/links/setup.js
+++ b/chrome/content/links/setup.js
@@ -186,7 +186,7 @@ Tabmix.beforeBrowserInitOnLoad = function() {
[window, "delayedStartup"];
let insertionPoint, ssPromise = "";
- if (this.isVersion(250)) {
+ if (this.isVersion(250, 250)) {
insertionPoint = "PlacesToolbarHelper.init();";
if (!this.isVersion(270))
ssPromise = 'typeof ssPromise == "object" ? ssPromise : null';
diff --git a/chrome/content/minit/minit.js b/chrome/content/minit/minit.js
index 9cfebe3..61b6485 100644
--- a/chrome/content/minit/minit.js
+++ b/chrome/content/minit/minit.js
@@ -1117,7 +1117,7 @@ Tabmix.navToolbox = {
return;
// InstantFox extension uses old version of gURLBar.handleCommand until Firefox 25
- let instantFox = !Tabmix.isVersion(250) && typeof InstantFox == "object";
+ let instantFox = !Tabmix.isVersion(250, 250) && typeof InstantFox == "object";
// we don't do anything regarding IeTab and URL Suffix extensions
_handleCommand = Tabmix.changeCode(obj, "gURLBar." + fn, {silent: this.urlBarInitialized})._replace(
diff --git a/chrome/content/session/session.js b/chrome/content/session/session.js
index fe50873..1829a5c 100644
--- a/chrome/content/session/session.js
+++ b/chrome/content/session/session.js
@@ -271,7 +271,7 @@ var TabmixSessionManager = {
this._sendRestoreCompletedNotifications(false);
}.bind(this);
- if (Tabmix.isVersion(250) && !TabmixSvc.sm.promiseInitialized) {
+ if (Tabmix.isVersion(250, 250) && !TabmixSvc.sm.promiseInitialized) {
Tabmix.ssPromise = aPromise || TabmixSvc.ss.promiseInitialized;
Tabmix.ssPromise.then(initializeSM)
.then(null, Cu.reportError);
diff --git a/chrome/content/session/sessionStore.js b/chrome/content/session/sessionStore.js
index 34705f7..08f4f21 100644
--- a/chrome/content/session/sessionStore.js
+++ b/chrome/content/session/sessionStore.js
@@ -10,7 +10,7 @@ var TMP_SessionStore = {
// make sure sessionstore is init
_ssInited: null,
initService: function TMP_ss_start() {
- if (Tabmix.isVersion(250) || this._ssInited)
+ if (Tabmix.isVersion(250, 250) || this._ssInited)
return;
try {
TabmixSvc.ss.init(window);
@@ -246,7 +246,7 @@ var TMP_SessionStore = {
let ss = Cc["@mozilla.org/browser/sessionstartup;1"].
getService(Ci.nsISessionStartup);
// when TMP session manager is enabled ss.doRestore is true only after restart
- if (!Tabmix.isVersion(250))
+ if (!Tabmix.isVersion(250, 250))
return ss.doRestore();
ss.onceInitialized.then(function() {
Tabmix.isWindowAfterSessionRestore = ss.doRestore();
diff --git a/chrome/content/utils.js b/chrome/content/utils.js
index b9f9c76..2d6f59d 100644
--- a/chrome/content/utils.js
+++ b/chrome/content/utils.js
@@ -11,8 +11,8 @@ var Tabmix = {
return this.defaultPrefs = Services.prefs.getDefaultBranch("extensions.tabmix.");
},
- isVersion: function(aVersionNo) {
- return TabmixSvc.version(aVersionNo);
+ isVersion: function() {
+ return TabmixSvc.version.apply(null, arguments);
},
// for debug
diff --git a/install.rdf b/install.rdf
index 9a9cb03..5a089ab 100644
--- a/install.rdf
+++ b/install.rdf
@@ -16,9 +16,14 @@
NS1:creator="ONEMEN (tabmix.onemen at gmail.com)"
NS1:developer="ONEMEN">
<NS1:targetApplication RDF:resource="rdf:#$n83In3"/>
+ <NS1:targetApplication RDF:resource="rdf:#$n74Pm2"/>
</RDF:Description>
<RDF:Description RDF:about="rdf:#$n83In3"
NS1:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
NS1:minVersion="17.0"
NS1:maxVersion="36.0a1" />
+ <RDF:Description RDF:about="rdf:#$n74Pm2"
+ NS1:id="{8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}"
+ NS1:minVersion="25.0"
+ NS1:maxVersion="25.*" />
</RDF:RDF>
diff --git a/modules/Services.jsm b/modules/Services.jsm
index bdf7381..2f7e741 100644
--- a/modules/Services.jsm
+++ b/modules/Services.jsm
@@ -9,6 +9,13 @@ Cu.import("resource://gre/modules/Services.jsm");
let _versions = {};
function isVersion(aVersionNo) {
+ if (TabmixSvc.isPaleMoonID) {
+ let paleMoonVer = arguments.length > 1 ? arguments[1] : -1;
+ if (aVersionNo > 240 && paleMoonVer == -1)
+ return false;
+ aVersionNo = paleMoonVer;
+ }
+
if (typeof _versions[aVersionNo] == "boolean")
return _versions[aVersionNo];
@@ -22,8 +29,8 @@ let TabmixSvc = {
this.prefBranch.getBoolPref("enableDebug");
},
- version: function(aVersionNo) {
- return isVersion(aVersionNo);
+ version: function() {
+ return isVersion.apply(null, arguments);
},
getString: function(aStringKey) {
@@ -181,7 +188,7 @@ let TabmixSvc = {
get ss() {
delete this.ss;
- if (isVersion(250)) {
+ if (isVersion(250, 250)) {
let tmp = {}
Cu.import("resource:///modules/sessionstore/SessionStore.jsm", tmp);
return this.ss = tmp.SessionStore;
@@ -252,6 +259,10 @@ XPCOMUtils.defineLazyGetter(TabmixSvc, "isPaleMoon", function () {
return Services.appinfo.name == "Pale Moon";
});
+XPCOMUtils.defineLazyGetter(TabmixSvc, "isPaleMoonID", function () {
+ return Services.appinfo.ID == "{8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}";
+});
+
/**
* bug 1051017 - Firefox 34 - change
* browser.contentWindow -> browser.contentWindowAsCPOW
--
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