XMLHttpRequest problem in Firefox extension I'm developing

Hi juraj.masiar

Thanks for your answer.

It is clear that in the second version of the js code the request is made outside any function. I was just trying to show the strange issue I’m facing: network request works outside the function but not inside it.

I’ve modified the code to use fetch, but the behavior is exactly the same: fetch outside the function performs the network request, but not inside the function.

So, it is not about using fetch or xmlhttprequest, but about some kind of restriction or similar that I’m not aware about.

Thanks anyway for the proposal.