1

how to prevent firefox from making a specific request to an url, ex: site.com/ajax/something.php i have found a lot of addons but they couldn't really do the job they can block requests to another domain but not an absolute uri, Is there any way to accomplish this ?

0x3h
  • 452
  • 9
  • 22
  • https://addons.mozilla.org/en-Us/firefox/addon/facebook-seen-blocker/ – epascarello Jul 15 '15 at 04:18
  • 1
    Ad Block lets you block by url in it options or build your own filters https://adblockplus.org/en/filters – epascarello Jul 15 '15 at 04:35
  • Questions about **general computing hardware and software are off-topic** for Stack Overflow unless they directly involve tools used primarily for programming. You may be able to get help on [Super User](http://superuser.com/about). – Makyen Jul 16 '15 at 06:43
  • Chrome does this builtin, just select the network request in the networks tab and block it (you have to have developers console open, and "block requests" option turned on for this) – jpenna Jun 29 '18 at 13:06

2 Answers2

3

The solution with addons is to use AdsBlockPlus->Filter preferences->Add filter, then simply put the url after || eg: ||facebook.com/ajax/mercury/change_read_status.phpwhich will prevent any requests to the url, Programmatically @Noitidart link is a perfect solution i was looking for that too.

0x3h
  • 452
  • 9
  • 22
  • Thanks for sharin! I really want to learn how AdBlock Plus programtically does it, its much more performant then my method I think, because it uses `nsIContentPolicy` I think. – Noitidart Jul 16 '15 at 08:30
2

Here you go man: firefox extension: intercepting url it is requesting and blocking conditionally

That uses observer service. Ideally you want to use nsIContentPolicy which i think is more performant but i dont have a solution with that to share. The Adblock Plus author is on this forum he may be able to give us a solution i can spam. :P

Community
  • 1
  • 1
Noitidart
  • 35,443
  • 37
  • 154
  • 323