# Additional "/" in web\_accessible\_resources in Firefox MV3

**URL:** <https://discourse.mozilla.org/t/additional-in-web-accessible-resources-in-firefox-mv3/142082>\
**Category:** Add-on Support\
**Created:** [April 2, 2025, 12:25am UTC](https://discourse.mozilla.org/t/additional-in-web-accessible-resources-in-firefox-mv3/142082 "2025-04-02T00:25:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![yacine-bens](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/yacine-bens/32/72195_2.png) [@yacine-bens](https://discourse.mozilla.org/u/yacine-bens)\
**Post date:** [April 2, 2025, 12:25am UTC](https://discourse.mozilla.org/t/additional-in-web-accessible-resources-in-firefox-mv3/142082/1 "2025-04-02T00:25:02Z")

</div>

Greetings,

I have an extension developed for Firefox MV3. In the manifest file, `web_accessible_resources` are specified as `file.html` or `script.js`, but when I import it in Firefox there’s an additional slash character `/file.html`, `/script.js`. I can check using `browser.runtime.getManifest()`.

Is there a way to get around this? Thanks.

---

<div class="post-metadata">

**Author:** ![dotproto](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/dotproto/32/62957_2.png) [@dotproto](https://discourse.mozilla.org/u/dotproto)\
**Post date:** [April 2, 2025, 1:36am UTC](https://discourse.mozilla.org/t/additional-in-web-accessible-resources-in-firefox-mv3/142082/2 "2025-04-02T01:36:11Z")

</div>

What do you mean when you say “when i import it in Firefox”? What problem(s) is the slash causing?

---

<div class="post-metadata">

**Author:** ![yacine-bens](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/yacine-bens/32/72195_2.png) [@yacine-bens](https://discourse.mozilla.org/u/yacine-bens)\
**Post date:** [April 2, 2025, 1:55am UTC](https://discourse.mozilla.org/t/additional-in-web-accessible-resources-in-firefox-mv3/142082/3 "2025-04-02T01:55:44Z")

</div>

I mean when I install it. I’m using a package that accesses some files listed in web\_accessible\_resources, however with the slash character present, it can’t seem to find those files. This doesn’t happen in mv2, only in mv3.

---

<div class="post-metadata">

**Author:** ![dotproto](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/dotproto/32/62957_2.png) [@dotproto](https://discourse.mozilla.org/u/dotproto)\
**Post date:** [April 2, 2025, 9:11pm UTC](https://discourse.mozilla.org/t/additional-in-web-accessible-resources-in-firefox-mv3/142082/4 "2025-04-02T21:11:16Z")

</div>

I just tested declaring resources with and without a leading / in `web_accessible_resources` and getting resource URLs with and without a leading / using `runtime.getURL()` and all worked expected.

At the moment my best guess is that you have a build step that’s doing something unexpected. Can you share a link to a repository or some example code?

---

<div class="post-metadata">

**Author:** ![yacine-bens](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/yacine-bens/32/72195_2.png) [@yacine-bens](https://discourse.mozilla.org/u/yacine-bens)\
**Post date:** [April 2, 2025, 9:47pm UTC](https://discourse.mozilla.org/t/additional-in-web-accessible-resources-in-firefox-mv3/142082/5 "2025-04-02T21:47:55Z")

</div>

Sure, here’s an example: [GitHub - yacine-bens/mellowtel-wxt](https://github.com/yacine-bens/mellowtel-wxt)

After building using `npm run build:firefox:mv3`, the resources are declared without / in the manifest file.

`runtime.getUrl()` does indeed return the correct url in both cases, but the package is trying to access the files directly from the manifest using `runtime.getManifest()`, in this case there will be a leading / in each string in resources array.

---

<div class="post-metadata">

**Author:** ![dotproto](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/dotproto/32/62957_2.png) [@dotproto](https://discourse.mozilla.org/u/dotproto)\
**Post date:** [April 2, 2025, 10:45pm UTC](https://discourse.mozilla.org/t/additional-in-web-accessible-resources-in-firefox-mv3/142082/6 "2025-04-02T22:45:56Z")

</div>

IMO this looks like a bug in one of your dependencies.

Currently the mellowtel library is checking the `web_accessible_resources` array for exact string matches ([1](https://github.com/mellowtel-inc/mellowtel-js/blob/40f22fa38cbe21b11ada450408d672cb8e4ebcd6/src/pascoli/pascoli-utils.ts#L34), [2](https://github.com/mellowtel-inc/mellowtel-js/blob/40f22fa38cbe21b11ada450408d672cb8e4ebcd6/src/pascoli/pascoli-utils.ts#L42)). Instead, they should be checking against a normalized version of the `web_accessible_resources` data.

Matching directly against the value returned by `runtime.getManifest()` is unreliable because it’s an interpretation of the manifest file, not a 1:1 match of the JSON file bundled with the extension. If they want to get the exact value of the resources declared in `web_accessible_resources`, they should directly use `fetch("manifest.json")` to retrieve the file. And even then that JSON file should be normalized to account for different ways of authoring those strings.

---

<div class="post-metadata">

**Author:** ![yacine-bens](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/yacine-bens/32/72195_2.png) [@yacine-bens](https://discourse.mozilla.org/u/yacine-bens)\
**Post date:** [April 3, 2025, 2:50pm UTC](https://discourse.mozilla.org/t/additional-in-web-accessible-resources-in-firefox-mv3/142082/7 "2025-04-03T14:50:22Z")

</div>

Yeah, that makes sense. I’ll notify the authors of the library.

Thank you for your assistance.
