Cannot acces a web-accessible-resource through "moz-extension://<extension-id>/<path/to/resource>"

I am trying to detect if an extension is installed by accessing a web-accessible-resource as described here:

https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/web_accessible_resources

The id listed in the manifest is foo@bar.com and the accessible file is correctly listed in the manifest (and named copyright.txt)

So i would expect that can can access this file through

moz-extension://foo@bar.com/copyright.txt

but this leads to nothing.

The complete analogue situation, with a Chrome Extension, does return the copyright.txt.

There is very little documentation on this. What am I doing wrong or missing here?

Cheers,
Meron

The id is different for each installation:
https://discourse.mozilla-community.org/t/constant-or-well-known-mox-extension-uuid-for-webextension/9701?u=desktopd


So you need to use this…

We have the same issue - the problem with extension.getURL() is that it can only run from the extension itself, meaning that we’ll need to ‘communicate’ the extension URL to the web page somehow (i.e. inject an invisible div).

Since we use the web_accessible_resources just to detect prior installation of our extensions, then we might as well give up completely on web_accessible_resources and just inject an invisible div which will indicate to our webpage that the extension has been previously installed.

Is there any possible better way to detect previous extension installs? Perhaps we need to somehow specify a permanent extension ID?