Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to disable a specific JS script from a specific website without disabling the javascript completely. Is there a way to do that ?

share|improve this question

migrated from stackoverflow.com May 3 '11 at 15:12

This question came from our site for professional and enthusiast programmers.

3 Answers 3

(Reference: http://noscript.net/faq#qa8_10)

After installing NoScript, open its option (by opening context menu on the small icon on the status bar/add-on bar, or through Addons Manager)

Go to Advanced tab. In that page, go to ABE tab. Under Rulesets, click on USER. Here is an example ruleset, put it in the textbox on the right:

# User-defined rules. Feel free to experiment here.
Site http://res.nimg.jp/js/ads.js*
Deny

I'm not sure how URL matching works, whether it uses regexp or not. Some examples on the FAQ does show regexp usage, but my example above seems to also match ads.js?foobarbaz.

share|improve this answer

If you're using Firefox, the NoScript plugin will allow you to do this.

http://noscript.net/

share|improve this answer
    
+1 - NoScript is exactly what you seek. As far as I know you'll need the Firefox browser to use it. Great extension. –  boehj May 4 '11 at 6:41
    
I can't cancel my downvote! Aaaaah! –  syockit Jul 1 '11 at 13:20
    
@syockit - I edited the answer. You should be able to change your vote now. Thanks. –  Iszi Jul 1 '11 at 13:52

If you are using Firefox, you can also use AdBlock Plus to block all functions in a specific file. (Instructions below are for Windows.)

  • In the toolbar, click the AdBlock Plus icon, and select Open blockable items from the menu.
  • A window will appear, listing everything that ABP can block. You can scroll through the list to find the particular script file or you can type in the Search box to narrow the list down. Once you've found the file to block, right-click the file and select Block this item ....
  • ABP will create a new filter based on that file and will list several options for you:
    1. The complete path to the file (www.domain.com/scripts/ascriptyoudontlike.js)
    2. Any file in that subdomain (www.domain.com)
    3. Any file in that domain (domain.com)
    4. A custom rule that you can define; by default, this starts off the same as 1.
  • Click the radio button next to the first option and click Add filter. This will close the window and add that JavaScript file to the list of blocked items.

You may need to refresh the page to ensure that file is blocked.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.