diff --git a/mobile/android/geckoview/api.txt b/mobile/android/geckoview/api.txt index 47893bb3fc04..15fc1eda8b7a 100644 --- a/mobile/android/geckoview/api.txt +++ b/mobile/android/geckoview/api.txt @@ -1683,6 +1683,7 @@ package org.mozilla.geckoview { field @NonNull public final String[] origins; field @NonNull public final String[] permissions; field public final int signedState; + field public final boolean temporary; field @NonNull public final String version; } diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/WebExtension.java b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/WebExtension.java index a31d1aed04d6..525ced132a45 100644 --- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/WebExtension.java +++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/WebExtension.java @@ -1658,6 +1658,12 @@ public class WebExtension { */ public final boolean enabled; + /** + * Whether this extension is temporary or not. Temporary extensions are not retained + * and will be uninstalled when the browser exits. + */ + public final boolean temporary; + /** Override for testing. */ protected MetaData() { icon = null; @@ -1676,6 +1682,7 @@ public class WebExtension { signedState = SignedStateFlags.UNKNOWN; disabledFlags = 0; enabled = true; + temporary = false; baseUrl = null; allowedInPrivateBrowsing = false; } @@ -1695,6 +1702,7 @@ public class WebExtension { isRecommended = bundle.getBoolean("isRecommended"); blocklistState = bundle.getInt("blocklistState", BlocklistStateFlags.NOT_BLOCKED); enabled = bundle.getBoolean("enabled", false); + temporary = bundle.getBoolean("temporary", false); baseUrl = bundle.getString("baseURL"); allowedInPrivateBrowsing = bundle.getBoolean("privateBrowsingAllowed", false); diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/doc-files/CHANGELOG.md b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/doc-files/CHANGELOG.md index 70a8ff9c4eec..b49a597c1f77 100644 --- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/doc-files/CHANGELOG.md +++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/doc-files/CHANGELOG.md @@ -18,8 +18,12 @@ exclude: true Also, [`MediaSession.Delegate.onMetadata`][83.1] is no longer dispatched for plain media elements. ([bug 1658937]({{bugzilla}}1658937)) +- Added [`WebExtension.MetaData.temporary`][83.2] which exposes whether an extension + has been installed temporarily, e.g. when using web-ext. + ([bug 1624410]({{bugzilla}}1624410)) [83.1]: {{javadoc_uri}}/MediaSession.Delegate.html#onMetadata-org.mozilla.geckoview.GeckoSession-org.mozilla.geckoview.MediaSession-org.mozilla.geckoview.MediaSession.Metadata- +[83.2]: {{javadoc_uri}}/WebExtension.MetaData.html#temporary ## v82 - ⚠️ [`WebNotification.source`][79.2] is now `@Nullable` to account for @@ -809,4 +813,4 @@ to allow adding gecko profiler markers. [65.24]: {{javadoc_uri}}/CrashReporter.html#sendCrashReport-android.content.Context-android.os.Bundle-java.lang.String- [65.25]: {{javadoc_uri}}/GeckoResult.html -[api-version]: 8cbbe3b03d78c33888562ea18a4554cff90f531d +[api-version]: 01fdaf45cfe4dc5974de314cbdb79584781eb282 diff --git a/mobile/android/modules/geckoview/GeckoViewWebExtension.jsm b/mobile/android/modules/geckoview/GeckoViewWebExtension.jsm index 2b7556977c31..2bfe72867969 100644 --- a/mobile/android/modules/geckoview/GeckoViewWebExtension.jsm +++ b/mobile/android/modules/geckoview/GeckoViewWebExtension.jsm @@ -282,6 +282,7 @@ async function exportExtension(aAddon, aPermissions, aSourceURI) { blocklistState, userDisabled, embedderDisabled, + temporarilyInstalled, isActive, isBuiltin, id, @@ -319,6 +320,7 @@ async function exportExtension(aAddon, aPermissions, aSourceURI) { promptPermissions, description, enabled: isActive, + temporary: temporarilyInstalled, disabledFlags, version, creatorName,