зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1386457 - Export Screenshots 10.10.0 to Firefox r=mossop
MozReview-Commit-ID: EHo04J8Y2Wu --HG-- extra : rebase_source : 89513d2ecde08b373c5972318e8aebebd89c9d88
This commit is contained in:
Родитель
9093b7fdf7
Коммит
3c41a35e8d
|
@ -20,7 +20,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "LegacyExtensionsUtils",
|
|||
|
||||
let addonResourceURI;
|
||||
let appStartupDone;
|
||||
const appStartupPromise = new Promise((resolve, reject) => {
|
||||
let appStartupPromise = new Promise((resolve, reject) => {
|
||||
appStartupDone = resolve;
|
||||
});
|
||||
|
||||
|
@ -39,7 +39,7 @@ const prefObserver = {
|
|||
// aData is the name of the pref that's been changed (relative to aSubject)
|
||||
if (aData == USER_DISABLE_PREF || aData == SYSTEM_DISABLE_PREF) {
|
||||
// eslint-disable-next-line promise/catch-or-return
|
||||
appStartupPromise.then(handleStartup);
|
||||
appStartupPromise = appStartupPromise.then(handleStartup);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -72,7 +72,7 @@ function startup(data, reason) { // eslint-disable-line no-unused-vars
|
|||
prefObserver.register();
|
||||
addonResourceURI = data.resourceURI;
|
||||
// eslint-disable-next-line promise/catch-or-return
|
||||
appStartupPromise.then(handleStartup);
|
||||
appStartupPromise = appStartupPromise.then(handleStartup);
|
||||
}
|
||||
|
||||
function shutdown(data, reason) { // eslint-disable-line no-unused-vars
|
||||
|
@ -81,7 +81,8 @@ function shutdown(data, reason) { // eslint-disable-line no-unused-vars
|
|||
id: ADDON_ID,
|
||||
resourceURI: addonResourceURI
|
||||
});
|
||||
stop(webExtension, reason);
|
||||
// Because the prefObserver is unregistered above, this _should_ terminate the promise chain.
|
||||
appStartupPromise = appStartupPromise.then(() => { stop(webExtension, reason); });
|
||||
}
|
||||
|
||||
function install(data, reason) {} // eslint-disable-line no-unused-vars
|
||||
|
@ -103,15 +104,16 @@ function handleStartup() {
|
|||
});
|
||||
|
||||
if (!shouldDisable() && !webExtension.started) {
|
||||
start(webExtension);
|
||||
return start(webExtension);
|
||||
} else if (shouldDisable()) {
|
||||
stop(webExtension, ADDON_DISABLE);
|
||||
return stop(webExtension, ADDON_DISABLE);
|
||||
}
|
||||
}
|
||||
|
||||
function start(webExtension) {
|
||||
webExtension.startup(startupReason).then((api) => {
|
||||
return webExtension.startup(startupReason).then((api) => {
|
||||
api.browser.runtime.onMessage.addListener(handleMessage);
|
||||
return Promise.resolve(null);
|
||||
}).catch((err) => {
|
||||
// The startup() promise will be rejected if the webExtension was
|
||||
// already started (a harmless error), or if initializing the
|
||||
|
@ -124,7 +126,7 @@ function start(webExtension) {
|
|||
}
|
||||
|
||||
function stop(webExtension, reason) {
|
||||
webExtension.shutdown(reason);
|
||||
return Promise.resolve(webExtension.shutdown(reason));
|
||||
}
|
||||
|
||||
function handleMessage(msg, sender, sendReply) {
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
</Description>
|
||||
</em:targetApplication>
|
||||
<em:type>2</em:type>
|
||||
<em:version>10.9.0</em:version>
|
||||
<em:version>10.10.0</em:version>
|
||||
<em:bootstrap>true</em:bootstrap>
|
||||
<em:homepageURL>https://pageshot.net/</em:homepageURL>
|
||||
<em:multiprocessCompatible>true</em:multiprocessCompatible>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"manifest_version": 2,
|
||||
"name": "Firefox Screenshots",
|
||||
"version": "10.9.0",
|
||||
"version": "10.10.0",
|
||||
"description": "__MSG_addonDescription__",
|
||||
"author": "__MSG_addonAuthorsList__",
|
||||
"homepage_url": "https://github.com/mozilla-services/screenshots",
|
||||
|
|
Загрузка…
Ссылка в новой задаче