5

This seems to be a frequently asked question but with no working answers as of now. I have tried almost every single chrome extension out there, but there's none which allows me to block JS at a script level. All they do is block at a domain level, which I do not want.

Any idea how I can do that please? Example below:

http://example.com/wp-content/plugins/sociallocker-next-premium/bizpanda/assets/js/lockers.010217.min.js

  • Adblock Plus should allow you to do this. I know how to do it in Firefox; Simply got to the webpage, then click the ABP icon, select "Open blockable items" and then you'll get a list of all the scripts and other items from that site at the bottom of your webpage. Right click the item you want and select "Block this" after that you have a window where you can select anything from that exact item down to everything from that domain and various choices in-between. – Mokubai Jun 25 '17 at 12:48
  • I tried both ABP and adblock on chrome but they don't have a place for me to enter the javascript link directly. It is not visible on the site itself, hence I can't right click on the element. Also, the script is not listed on ABP but it's found in the source code. – Automator_Enthusiast Jun 26 '17 at 03:22

2 Answers2

5

These instruction is valid for Google Chrome:

  1. Right Click anywhere on your website, click "Inspect Elements"

  2. The Developer Tools will appear. On the developer tools, go to the the Network tab. Find the JS file you want to block (e.g: lockers.010217.min.js)

  3. Right click on the JS file and choose "block request url".

  4. You can also block any file from the same domain by choosing "block request domain".

hyxer
  • 3
1

here is a list of uBlock Origin rules that do precisely that. Actually, the first line blocks scripts in the wp-content/plugins directory for any website and the subsequent rules are just exceptions to that rule. I use it to get rid of all Wordpress Plugin scripts except those that actually make a website work for me.

https://github.com/jawz101/ublockOrigin_wordpressWhitelist

https://github.com/jawz101/ublockOrigin_wordpressWhitelist/blob/master/my-ublock-static-filters_wordpressWhitelist.txt

jawz101
  • 11
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review – DarkDiamond Mar 13 '22 at 08:39