Skip to content

Commit b09e28b

Browse files
authored
🤖 Merge PR DefinitelyTyped#73809 [chrome] add extension_ids, use_dynamic_url to mv3 web_accessible_resources by @aeharding
1 parent 1411623 commit b09e28b

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

‎types/chrome/index.d.ts‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9296,7 +9296,18 @@ declare namespace chrome {
92969296
optional_permissions?: ManifestOptionalPermissions[] | undefined;
92979297
optional_host_permissions?: string[] | undefined;
92989298
permissions?: ManifestPermissions[] | undefined;
9299-
web_accessible_resources?: Array<{ resources: string[]; matches: string[] }> | undefined;
9299+
web_accessible_resources?:
9300+
| Array<
9301+
& {
9302+
resources: string[];
9303+
use_dynamic_url?: boolean | undefined;
9304+
}
9305+
& (
9306+
| { extension_ids: string[]; matches?: string[] | undefined }
9307+
| { matches: string[]; extension_ids?: string[] | undefined }
9308+
)
9309+
>
9310+
| undefined;
93009311
}
93019312

93029313
export type Manifest = ManifestV2 | ManifestV3;

‎types/chrome/test/index.ts‎

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,24 @@ function testGetManifest() {
922922
manifest.optional_host_permissions; // $ExpectType string[] | undefined
923923
manifest.permissions; // $ExpectType ManifestPermissions[] | undefined
924924

925-
manifest.web_accessible_resources = [{ matches: ["https://*/*"], resources: ["resource.js"] }];
925+
manifest.web_accessible_resources = [{
926+
resources: ["resource.js"],
927+
use_dynamic_url: true,
928+
matches: ["https://*/*"],
929+
extension_ids: ["*"],
930+
}];
931+
manifest.web_accessible_resources = [{
932+
resources: ["resource.js"],
933+
matches: ["https://*/*"],
934+
}];
935+
manifest.web_accessible_resources = [{
936+
resources: ["resource.js"],
937+
extension_ids: ["*"],
938+
}];
939+
// @ts-expect-error
940+
manifest.web_accessible_resources = [{
941+
resources: ["resource.js"],
942+
}];
926943
// @ts-expect-error
927944
manifest.web_accessible_resources = ["script.js"];
928945

@@ -991,6 +1008,8 @@ function testGetManifest() {
9911008
{
9921009
matches: ["https://*/*"],
9931010
resources: ["some-script.js"],
1011+
extension_ids: ["*"],
1012+
use_dynamic_url: true,
9941013
},
9951014
],
9961015
};

0 commit comments

Comments
 (0)