5

I use a page with a very annoying alert onLoad, I'd like to block JavaScript on that site (it's http://example.com/home.jsf), but I need JS to use the rest of the web-app.

Can I block scripts only on home.jsf?

5 Answers 5

3

I don't know if you can do it with NoScript, but you might be able to do it with GreaseMonkey by replacing the function or clearing the onLoad.

2
  • i think GM is fired after the page has already loaded, can I really stop this alert?
    – IAdapter
    Commented Jan 10, 2011 at 16:48
  • The GreaseMonkey uses DOMContentLoaded ; this fires before window.onLoad, which doesn't fire until after the page is finished rendering ... I haven't tested to verify, though
    – Joe
    Commented Jan 10, 2011 at 17:06
7

It's not the most intuitive of things, but you can do it using NoScript's Application Boundaries Enforcer.

I explained how to block just Google Search's Javascript (to kill Google Instant without logging in while still allowing easy login and use on other Google sub-sites) at How to make Google Search scriptless with NoScript/AdBlock?

You can also use it to lock scripts from sites like Facebook into the domain they come from, so scripts from Facebook will only load if you're actually on Facebook. (Good for killing off stuff like "Like This", "Tweet This", and Google Buzz buttons so you don't have to trust them as far as your privacy and browser responsiveness go):

# facebook.com containment rule
# This rule allows Facebook scripts objects and frames to be included only
# from Facebook pages
Site .facebook.com .fbcdn.net
Accept from .facebook.com .fbcdn.net
Deny INCLUSION(SCRIPT, OBJ, SUBDOC)

# twitter.com containment rule
# Like the Facebook rule, but for twitter
Site twitter.com .twitter.com twimg.com .twimg.com
Accept from twitter.com .twitter.com twimg.com .twimg.com
Deny INCLUSION(SCRIPT, OBJ, SUBDOC)

# Google Buzz containment rule
# Like the Facebook rule, but for Google
Site ^https?://www\.google\.com/buzz/.*
Accept from google.com .google.com googleapis.com .googleapis.com
Deny INCLUSION(SCRIPT, OBJ, SUBDOC)
0
1

You should be able to using the blacklist functionality. As opposed to the usual whitelist of sites that you allow.

1

NoScript deals with "domains" rather then pages.

Generally no, [url=http://forums.informaction.com/viewtopic.php?f=7&t=5468]Possible to enable scripts on one specific page?[/url].

Though there are a lot of "other" features that NoScript offers that may help (just don't ask me which, though I do seem to recall some discussion of an annoyance on a particular banks website.)

1
  • The formatting language used here is MarkDown, so the inline syntax (not using footnotes) is [link text](url)
    – Joe
    Commented Jan 10, 2011 at 16:57
0

Try AdBlock Plus.

I presume you have the addon already. Use "Open Blockable Items" to select and create a filter. Along with ABP Element Hiding Helper, this is how I clean up over-cluttered pages.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .