@@ -26,6 +26,9 @@ export namespace Manifest {
2626 */
2727 browser_specific_settings ?: BrowserSpecificSettings ;
2828
29+ /**
30+ * Name must be at least 2, at should be at most 75 characters
31+ */
2932 name : string ;
3033
3134 /**
@@ -97,10 +100,7 @@ export namespace Manifest {
97100 /**
98101 * Optional.
99102 */
100- background ?:
101- | WebExtensionManifestBackgroundC1Type
102- | WebExtensionManifestBackgroundC2Type
103- | WebExtensionManifestBackgroundC3Type ;
103+ background ?: WebExtensionManifestBackgroundType ;
104104
105105 /**
106106 * Alias property for options_ui.page, ignored when options_ui.page is set. When using this property the options page is
@@ -279,6 +279,8 @@ export namespace Manifest {
279279 size : number ;
280280 }
281281
282+ type OptionalOnlyPermission = "trialML" | "userScripts" ;
283+
282284 type OptionalPermissionNoPrompt =
283285 | "idle"
284286 | "cookies"
@@ -320,7 +322,7 @@ export namespace Manifest {
320322 | "webNavigation"
321323 | "identity.email" ;
322324
323- type OptionalPermissionOrOrigin = OptionalPermission | MatchPattern ;
325+ type OptionalPermissionOrOrigin = OptionalPermission | OptionalOnlyPermission | MatchPattern ;
324326
325327 type PermissionPrivileged = "mozillaAddons" | "activityLog" | "networkStatus" | "normandyAddonStudy" ;
326328
@@ -673,40 +675,44 @@ export namespace Manifest {
673675 */
674676 type WebExtensionManifestIncognitoEnum = "not_allowed" | "spanning" | "split" ;
675677
676- interface WebExtensionManifestBackgroundC1Type {
677- page : ExtensionURL ;
678+ /**
679+ * Only supported for page/scripts; not for service_worker yet, see bug 1775574
680+ */
681+ type WebExtensionManifestBackgroundTypeEnum = "module" | "classic" ;
678682
683+ type WebExtensionManifestBackgroundPreferredEnvironmentItemEnum = "service_worker" | "document" ;
684+
685+ interface WebExtensionManifestBackgroundType {
679686 /**
680687 * Optional.
681688 */
682- persistent ?: boolean ;
683- }
689+ service_worker ?: ExtensionURL ;
684690
685- type WebExtensionManifestBackgroundC2TypeEnum = "module" | "classic" ;
691+ /**
692+ * Optional.
693+ */
694+ page ?: ExtensionURL ;
686695
687- interface WebExtensionManifestBackgroundC2Type {
688- scripts : ExtensionURL [ ] ;
696+ /**
697+ * Optional.
698+ */
699+ scripts ?: ExtensionURL [ ] ;
689700
690701 /**
702+ * Only supported for page/scripts; not for service_worker yet, see bug 1775574
691703 * Optional.
692704 */
693- type ?: WebExtensionManifestBackgroundC2TypeEnum ;
705+ type ?: WebExtensionManifestBackgroundTypeEnum ;
694706
695707 /**
696708 * Optional.
697709 */
698710 persistent ?: boolean ;
699- }
700-
701- interface WebExtensionManifestBackgroundC3Type {
702- service_worker : ExtensionURL ;
703711
704712 /**
705- * Even though Manifest V3, does not support multiple background scripts, you can optionally declare the service worker as
706- * an ES Module by specifying "type": "module", which allows you to import further code.
707713 * Optional.
708714 */
709- type ?: "module" ;
715+ preferred_environment ?: WebExtensionManifestBackgroundPreferredEnvironmentItemEnum [ ] ;
710716 }
711717
712718 interface WebExtensionManifestOptionsUiType {
@@ -761,37 +767,6 @@ export namespace Manifest {
761767 extension_ids ?: Array < ExtensionID | "*" > ;
762768 }
763769
764- interface WebExtensionManifestChromeSettingsOverridesSearchProviderParamsItemType {
765- /**
766- * A url parameter name
767- */
768- name : string ;
769-
770- /**
771- * The type of param can be either "purpose" or "pref".
772- * Optional.
773- */
774- condition ?: "purpose" | "pref" ;
775-
776- /**
777- * The preference to retrieve the value from.
778- * Optional.
779- */
780- pref ?: string ;
781-
782- /**
783- * The context that initiates a search, required if condition is "purpose".
784- * Optional.
785- */
786- purpose ?: "contextmenu" | "searchbar" | "homepage" | "keyword" | "newtab" ;
787-
788- /**
789- * A url parameter value.
790- * Optional.
791- */
792- value ?: string ;
793- }
794-
795770 interface WebExtensionManifestChromeSettingsOverridesSearchProviderType {
796771 name : string ;
797772
@@ -847,13 +822,6 @@ export namespace Manifest {
847822 * Optional.
848823 */
849824 is_default ?: boolean ;
850-
851- /**
852- * A list of optional search url parameters. This allows the additon of search url parameters based on how the search is
853- * performed in Firefox.
854- * Optional.
855- */
856- params ?: WebExtensionManifestChromeSettingsOverridesSearchProviderParamsItemType [ ] ;
857825 }
858826
859827 interface WebExtensionManifestChromeSettingsOverridesType {
0 commit comments