Bug 1697059 require favicon to be in the extension xpi r=Standard8

Differential Revision: https://phabricator.services.mozilla.com/D108270
This commit is contained in:
Shane Caraveo 2021-04-30 20:31:41 +00:00
parent 7d11b0aa66
commit 8b91be585f
2 changed files with 40 additions and 2 deletions

View File

@ -49,9 +49,18 @@
"preprocess": "localize"
},
"favicon_url": {
"type": "string",
"choices": [
{
"type": "string",
"format": "relativeUrl",
"max_manifest_version": 2
},
{
"type": "string",
"format": "strictRelativeUrl"
}
],
"optional": true,
"format": "relativeUrl",
"preprocess": "localize"
},
"suggest_url": {

View File

@ -552,3 +552,32 @@ add_task(async function test_extension_allow_http_for_localhost() {
await ext1.unload();
});
add_task(async function test_search_favicon_mv3() {
Services.prefs.setBoolPref("extensions.manifestV3.enabled", true);
let normalized = await ExtensionTestUtils.normalizeManifest({
manifest_version: 3,
chrome_settings_overrides: {
search_provider: {
name: "HTTP Icon in MV3",
search_url: "https://example.org/",
favicon_url: "https://example.org/icon.png",
},
},
});
Assert.ok(
normalized.error.endsWith("must be a relative URL"),
"Should have an error"
);
normalized = await ExtensionTestUtils.normalizeManifest({
manifest_version: 3,
chrome_settings_overrides: {
search_provider: {
name: "HTTP Icon in MV3",
search_url: "https://example.org/",
favicon_url: "/icon.png",
},
},
});
Assert.ok(!normalized.error, "Should not have an error");
});