The URLPatterns that are stored in the ExtensionPrefs don't store the valid schemes mask, and are reconstructed with the "default" valid schemes (Extension::kValidHostPermissionSchemes for explicit hosts, UserScript::ValidUserScriptSchemes(can_execute_everywhere=false) for user script hosts).
This has two issues:
- Technically, if an extension (say, an extension that is allowed to execute everywhere) has different schemes, they are not properly stored. In practice, I don't know if this ever really happens.
- If you look at GetGrantedPermissions()->explicit_hosts().MatchesURL(GURL("chrome://settings")), it will return true if the extension has <all_urls>, because the chrome scheme is allowed for chrome://favicon. We remove the chrome scheme from valid schemes when parsing the extension, so it doesn't show up in requested permissions, and thus is never granted to the extension, but it means that granted permissions are not a perfect reflection of what's actually granted.
We could update these to store a mask for each pattern, but that will need some code migration for existing clients. We could also just remove chrome://favicon, and this problem becomes less of an issue.