Hello this is my first add-ons development and I have a few questions.
I have a 4g box, when i fetch my box via a specific route (http://192.168.1.1/api/monitoring/month_statistics) i get the total amount of data i have downloaded for the current month.
I want to create an extension to avoid to go to the monitoring page for checking this data.
1 - is this possible to fetch a local ip address via an add-on ?
2 - what is the solution to do that ? I found that but the code seems a bit deprecated (I have the following error on my console The object "Components" is obsolete. It will be deleted soon.).
Are you looking for the local IP of the device the extension is running on? Or do you just want to make a request to that local IP in your example? If so, you can just use that url with fetch.
What you want to do is add a host permission for the IP of the router, so you can ignore CORS. If the IP is not hardcoded in the extension, you could just declare an optional permission of <all_urls>and then request the permission for the IP once you know it.