зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1600742 - Use WebExtensionPolicy instead of AddonManager for actions. r=snorp
Differential Revision: https://phabricator.services.mozilla.com/D56791 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
f8d68e46e1
Коммит
14f0d7f3b6
|
@ -448,12 +448,12 @@ var GeckoViewWebExtension = {
|
|||
},
|
||||
|
||||
async browserActionClick(aId) {
|
||||
const extension = await this.extensionById(aId);
|
||||
if (!extension) {
|
||||
const policy = WebExtensionPolicy.getByID(aId);
|
||||
if (!policy) {
|
||||
return;
|
||||
}
|
||||
|
||||
const browserAction = this.browserActions.get(extension);
|
||||
const browserAction = this.browserActions.get(policy.extension);
|
||||
if (!browserAction) {
|
||||
return;
|
||||
}
|
||||
|
@ -462,12 +462,12 @@ var GeckoViewWebExtension = {
|
|||
},
|
||||
|
||||
async pageActionClick(aId) {
|
||||
const extension = await this.extensionById(aId);
|
||||
if (!extension) {
|
||||
const policy = WebExtensionPolicy.getByID(aId);
|
||||
if (!policy) {
|
||||
return;
|
||||
}
|
||||
|
||||
const pageAction = this.pageActions.get(extension);
|
||||
const pageAction = this.pageActions.get(policy.extension);
|
||||
if (!pageAction) {
|
||||
return;
|
||||
}
|
||||
|
@ -476,11 +476,14 @@ var GeckoViewWebExtension = {
|
|||
},
|
||||
|
||||
async actionDelegateAttached(aId) {
|
||||
const extension = await this.extensionById(aId);
|
||||
if (!extension) {
|
||||
const policy = WebExtensionPolicy.getByID(aId);
|
||||
if (!policy) {
|
||||
debug`Could not find extension with id=${aId}`;
|
||||
return;
|
||||
}
|
||||
|
||||
const { extension } = policy;
|
||||
|
||||
const browserAction = this.browserActions.get(extension);
|
||||
if (browserAction) {
|
||||
// Send information about this action to the delegate
|
||||
|
|
Загрузка…
Ссылка в новой задаче