# Error on XHR from content script to local file without any effect

**URL:** <https://discourse.mozilla.org/t/error-on-xhr-from-content-script-to-local-file-without-any-effect/41809>\
**Category:** Development\
**Created:** [June 24, 2019, 10:25am UTC](https://discourse.mozilla.org/t/error-on-xhr-from-content-script-to-local-file-without-any-effect/41809 "2019-06-24T10:25:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![robbendebiene](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/robbendebiene/32/57506_2.png) [@robbendebiene](https://discourse.mozilla.org/u/robbendebiene)\
**Post date:** [June 24, 2019, 10:25am UTC](https://discourse.mozilla.org/t/error-on-xhr-from-content-script-to-local-file-without-any-effect/41809/1 "2019-06-24T10:25:45Z")

</div>

Hello dear community.  
When I’m making a XHR request to a file located in my add-on directory from a content script I get the following error message: Security Error: Content from `https://www.domain.com/ may not load or link moz-extension://addonid/resources/json/defaults.json` (I had to translate it so the error message may not perfectly match) Despite this error I still receive the content of the file.

This error does not occur when using fetch with mode: ‘same-origin’, but without “same-origin” it behaves like XHR.

Btw it doesn’t matter if I declare the file in web\_accessible\_resources.

Is this intended?  
Thanks in advance
