Build Chrome extensions quicker with a TypeScript boilerplate project
Download

Solved: Permission is unknown or URL pattern is malformed

ExtensionNinja | 2/25/2021

If you are migrating to Chrome extension v3 manifest, you may have run into URL pattern malformed error. You are probably confused since the same configuration worked before, but stopped working after switching to the manifest v3 version. First I will cover changes in URL permissions and then show how to update the manifest to remove this error.

Permissions and Optional Permissions no longer support URL patterns

Host access permissions (URL pattern) now have a dedicated place in the manifest. The new property is called “host_permissions”. Chrome extension documentation is not clear about this, because not all content is updated to reflect v3 manifest and sometimes still refers to v2 version.

At the moment of writing this article, even the permissions documentation page shows that URL pattern can be used in the permissions and optional_permissions lists. Watch out, this is no longer true in v3 manifest. See below how to update your manifest to resolve the error.

Quick fix

Move URL permission to the new “host_permissions” list. You can use same wildcard patterns as before.

"host_permissions": [
    "https://extension.ninja/*"
],

Don't miss latest Chrome extension developer news

Join Newsletter