Request permissions by path/query rather than just hostname

Hey there, I was just wondering if there’s a way to restrict my add-on’s permissions to a specific path/query on a website. For example, I would want my add-on to only be active on example.com/foo. However, if I specify this in the manifest.json:

"permissions": ["*://*.example.com/foo"]

The extension still activates on example.com. I can filter out the URLs in my script, but I would like users to feel more private, and it could also prevent bugs if my code is bad. It’s not a huge deal, but I would prefer to grant my add-on the strictest restrictions.

I think it’s possible, check the examples in the docs:

But be careful about this. I have a feeling you won’t be able to change it in the future (without alerting all existing users) if the target page changes paths!

Yeah, I looked at that, and it does work, I just wasn’t checking my add-on correctly. The problem was that I’m targeting multiple URLs, and the example.com website has resources with those other URLs. So when the add-on logged something to the console, it wasn’t because of example.com, but rather because example.com requests a resource from foo.com, and my extension also targets foo.com, so it activated. I just failed to realize that.