# "about" in a host permission

**URL:** <https://discourse.mozilla.org/t/about-in-a-host-permission/135934>\
**Category:** Add-ons\
**Created:** [September 21, 2024, 11:39am UTC](https://discourse.mozilla.org/t/about-in-a-host-permission/135934 "2024-09-21T11:39:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hans\_squared](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/hans_squared/32/67424_2.png) [@hans\_squared](https://discourse.mozilla.org/u/hans_squared)\
**Post date:** [September 21, 2024, 11:39am UTC](https://discourse.mozilla.org/t/about-in-a-host-permission/135934/1 "2024-09-21T11:39:41Z")

</div>

The attached extension requests the invalid host permisson “xyz”.

[Host Permission Regexp.zip](https://discourse.mozilla.org/uploads/short-url/dUEpDiAzHAK4FSpKJlNQeLpfYLu.zip) (2.3 KB)

When it’s loaded as a temporary add-on, FF displays a warning/error.

> Warning details
> 
> Reading manifest: Warning processing host\_permissions: Error processing host\_permissions.0: Value “xyz” 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:/

 ![grafik](https://us1.discourse-cdn.com/flex001/uploads/mozilla/original/3X/0/7/07ae8b0faa60338f75da971f14dc70c3f9a09d0b.png)

According to the last part, “about:” should be a valid match pattern.

> or match the pattern /^resource://(_|_.[^ _/]+|[^_ /]+)/.\*$|^about:

But the host permission “about:” just causes another error.

> Warning details
> 
> Reading manifest: Invalid extension permission: about:

 ![grafik](https://us1.discourse-cdn.com/flex001/uploads/mozilla/original/3X/3/1/317df142d0c2c8266eb1d2a9079ff791e52f008f.png)

Do I need to set a flag in about:config to use the host permission “about:”?  
Or is the first error message wrong/misleading?

---

<div class="post-metadata">

**Author:** ![juraj.masiar](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/juraj.masiar/32/30587_2.png) [@juraj.masiar](https://discourse.mozilla.org/u/juraj.masiar)\
**Post date:** [September 21, 2024, 2:46pm UTC](https://discourse.mozilla.org/t/about-in-a-host-permission/135934/2 "2024-09-21T14:46:04Z")

</div>

Realistically, there is only one “about” page that is “accessible” by addons, the “about:blank”, or maybe also “about:srcdoc”?

So, maybe if you write the whole URL?  
Also, I’m not sure what you are up to, but maybe this will help:

> <https://stackoverflow.com/questions/41408936/can-anyone-explain-that-what-is-the-use-of-match-about-blank-in-chrome-extensi/41410165#41410165>

---

<div class="post-metadata">

**Author:** ![evilpie](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/evilpie/32/30580_2.png) [@evilpie](https://discourse.mozilla.org/u/evilpie)\
**Post date:** [September 21, 2024, 5:05pm UTC](https://discourse.mozilla.org/t/about-in-a-host-permission/135934/3 "2024-09-21T17:05:16Z")

</div>

I think the error message is just wrong/confusing, resource and about matching is limited to privileged extensions: [https://searchfox.org/mozilla-central/rev/5049886134b906888fe78428bd298a94c4ee721e/toolkit/components/extensions/schemas/manifest.json#666](https://searchfox.org/mozilla-central/rev/5049886134b906888fe78428bd298a94c4ee721e/toolkit/components/extensions/schemas/manifest.json#666)

---

<div class="post-metadata">

**Author:** ![hans\_squared](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/hans_squared/32/67424_2.png) [@hans\_squared](https://discourse.mozilla.org/u/hans_squared)\
**Post date:** [September 21, 2024, 8:08pm UTC](https://discourse.mozilla.org/t/about-in-a-host-permission/135934/4 "2024-09-21T20:08:05Z")

</div>

> [@juraj.masiar](#):
>
> I’m not sure what you are up to

That sounds like a question 🙂

FF MV3 lets the user toggle an extension’s optional permissions in about:addons

I want to warn the user if they

- disable a permission the extension currently needs
- enable a permission the extension currently doesn’t need

```auto
browser.permissions.onAdded.addListener(async permissions => {
    let [active_tab] = await browser.tabs.query({ lastFocusedWindow: true, active: true });
    if (active_tab.url === "about:addons") {
        // If the extension doesn't need the permission, warn the user
        console.log("permissions.onAdded - check if we need to warn the user");
    }
    else {
        console.log("permissions.onAdded - don't warn the user");
    }
})

```

[https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs)

> To access Tab.url, Tab.title, and Tab.favIconUrl (or to filter by these properties via tabs.query()), you need to have the “tabs” permission, or have host permissions that match Tab.url.

With an “about:addons” host permission, I wouldn’t need the “tabs” permission.  
But I can live with requiring the “tabs” permission in this case.

---

<div class="post-metadata">

**Author:** ![hans\_squared](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/hans_squared/32/67424_2.png) [@hans\_squared](https://discourse.mozilla.org/u/hans_squared)\
**Post date:** [September 21, 2024, 8:08pm UTC](https://discourse.mozilla.org/t/about-in-a-host-permission/135934/5 "2024-09-21T20:08:59Z")

</div>

> [@evilpie](#):
>
> I think the error message is just wrong/confusing, resource and about matching is limited to privileged extensions: [manifest.json - mozsearch](https://searchfox.org/mozilla-central/rev/5049886134b906888fe78428bd298a94c4ee721e/toolkit/components/extensions/schemas/manifest.json#666)

Thank you, this answers my question!
