summaryrefslogtreecommitdiffstats
path: root/mobile/android/modules/geckoview/GeckoViewWebExtension.sys.mjs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /mobile/android/modules/geckoview/GeckoViewWebExtension.sys.mjs
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz
firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mobile/android/modules/geckoview/GeckoViewWebExtension.sys.mjs')
-rw-r--r--mobile/android/modules/geckoview/GeckoViewWebExtension.sys.mjs31
1 files changed, 26 insertions, 5 deletions
diff --git a/mobile/android/modules/geckoview/GeckoViewWebExtension.sys.mjs b/mobile/android/modules/geckoview/GeckoViewWebExtension.sys.mjs
index ae821a3656..97538fd6bb 100644
--- a/mobile/android/modules/geckoview/GeckoViewWebExtension.sys.mjs
+++ b/mobile/android/modules/geckoview/GeckoViewWebExtension.sys.mjs
@@ -158,7 +158,7 @@ class EmbedderPort {
data: holder.deserialize({}),
});
}
- onEvent(aEvent, aData, aCallback) {
+ onEvent(aEvent, aData) {
debug`onEvent ${aEvent} ${aData}`;
switch (aEvent) {
@@ -360,6 +360,23 @@ async function exportExtension(aAddon, aPermissions, aSourceURI) {
updateDate = null;
}
+ const normalizePermissions = perms => {
+ if (perms?.permissions) {
+ perms = { ...perms };
+ perms.permissions = perms.permissions.filter(
+ perm => !perm.startsWith("internal:")
+ );
+ }
+ return perms;
+ };
+
+ const optionalPermissions = aAddon.optionalPermissions?.permissions ?? [];
+ const optionalOrigins = aAddon.optionalPermissions?.origins ?? [];
+ const grantedPermissions =
+ normalizePermissions(await lazy.ExtensionPermissions.get(id)) ?? [];
+ const grantedOptionalPermissions = grantedPermissions?.permissions ?? [];
+ const grantedOptionalOrigins = grantedPermissions?.origins ?? [];
+
return {
webExtensionId: id,
locationURI: aSourceURI != null ? aSourceURI.spec : "",
@@ -393,6 +410,10 @@ async function exportExtension(aAddon, aPermissions, aSourceURI) {
temporary: temporarilyInstalled,
updateDate,
version,
+ optionalPermissions,
+ optionalOrigins,
+ grantedOptionalPermissions,
+ grantedOptionalOrigins,
},
};
}
@@ -528,7 +549,7 @@ class ExtensionPromptObserver {
resolve(response.allow);
}
- observe(aSubject, aTopic, aData) {
+ observe(aSubject, aTopic) {
debug`observe ${aTopic}`;
switch (aTopic) {
@@ -572,7 +593,7 @@ class AddonInstallObserver {
});
}
- observe(aSubject, aTopic, aData) {
+ observe(aSubject, aTopic) {
debug`observe ${aTopic}`;
switch (aTopic) {
case "addon-install-failed": {
@@ -758,7 +779,7 @@ class ExtensionProcessListener {
]);
}
- async onEvent(aEvent, aData, aCallback) {
+ async onEvent(aEvent, aData) {
debug`onEvent ${aEvent} ${aData}`;
switch (aEvent) {
@@ -872,7 +893,7 @@ async function updatePromptHandler(aInfo) {
}
export var GeckoViewWebExtension = {
- observe(aSubject, aTopic, aData) {
+ observe(aSubject, aTopic) {
debug`observe ${aTopic}`;
switch (aTopic) {