fregante / webext-permission-toggle

Browser-action context menu to request permission for the current tab.
https://fregante.github.io/webext-permission-toggle/
MIT License
70 stars 5 forks source link

Throws on `moz-extension://` pages #21

Closed fregante closed 9 months ago

fregante commented 3 years ago
  1. Open a page like moz-extension://c2d22e49-5f8e-b345-aa68-ad5a6f285630/manifest.json
  2. Notice error in Browser console
Error: Type error for parameter permissions (Error processing origins.0: Value "moz-extension://c2d22e49-5f8e-b345-aa68-ad5a6f285630/*" must either: be one of ["<all_urls>"], must either [match the pattern /^(https?|wss?|file|ftp|\*):\/\/(\*|\*\.[^*/]+|[^*/]+)\/.*$/, or match the pattern /^file:\/\/\/.*$/], or match the pattern /^resource:\/\/(\*|\*\.[^*/]+|[^*/]+)\/.*$|^about:/) for permissions.contains.
    checked index.js:14
    updateItem index.js:40
    <anonymous> index.js:144

I think *extension://* pages can never be matched, so they should be excluded a priori.

fregante commented 9 months ago

Same goes for chrome:// and about:blank pages. The generated glob is null/*

The solution is likely the same: