Permission for cross origin requests

I have a very simple Add-on that uses some validator I made on my site. It takes the input data and sends it to do my API which response with validation.

The only problem is the XMLrequest call as it doesn’t take place.

I have the following manifest:
{

“manifest_version”: 2,
“name”: “ContextValidator”,
“version”: “0.5.4”,
“description”: “Allowing the use of context validator in an add-on”,

“icons”: {
“48”: “icons/icon.png”
},

“content_scripts”: [
{
“matches”: [“<all_urls>”],
“js”: [“content_script.js”]
}
],

“permissions”: [
{
“cross-domain-content”: [“https://myapisitehere.com”]
}
]

}

But I get an error when trying to self-sign it:

  • Permissions should be string

Could somebody enlighten me, how to get these permissions?

I couldn’t find “cross-domain-content” here:

So I duckduckgoed “cross-domain-content”, and the first result was:

https://developer.mozilla.org/en-US/docs/Archive/Add-ons/Add-on_SDK/Guides/Content_Scripts/Cross_Domain_Content_Scripts

It looks like this manifest key doesn’t exist anymore in WebExtensions!

Use host permissions instead:

And instead of XMLrequest, I think you need to use XMLHttpRequest:

Or fetch:

Thanks, I solved it my self and came here to report. But your answer is right.

You need you need to use host permissions. For other people with the same problem:

In the permission array, type the URL of the site you want to do a request to. That should solve it.