Reputation: 13
i tried to send request to server and given respond with ajax but it is not working and after search, i find webRequest
api
How to use it correctly that include something like this:
url: https://example.com/example.php
method: post
param: name=john
Upvotes: 1
Views: 115
Reputation: 67
You wouldn't use the webRequest Api for that.
Nevertheless you are going to run into another problem: Cross Origin Resource Sharing (CORS)
If you want your extension to be able to make requests to example.org
you will need to ask for permission on that host. The permission request is being made in your manifest.json
as described here.
When you have granted your extension permission to the host, you can simply fetch data via ajax.
Upvotes: 1