How do you block specific java script from running?

fleabag

Banned
Oct 1, 2007
2,450
1
0
I have a site I'm trying to use but it's a pain in the ass because it incorrectly detects (or lack thereof) that I don't have SVG viewer or a PDF viewer. Every page I load, after it gets to the bottom (where the script is located) it then automagically redirects me without even a pause time to stop it from doing it. I know where the script is located on the site and I was wondering if there was a way I could block THAT specific script AND or is there a program sort of like Noscript where it allows you to one at a time approve a java script command or deny it much like booting up in safemode I believe (you have to add a -command, but I hope you get the point).

I was also wondering if anyone was aware of a way to get downthemall to not specifically download the URL you give it, but to go to that url, wait for it to load and THEN download the re-directing url. I search google numerous times and while it seems to mention that this issue was solved in 1.0 (I have the latest version) its behavior seems to suggest otherwise. I don't believe I need to use "Anticontainer" because that seems to be for sites like imageshack where it loads a page which has elements on it and then it's suppose to "search" for the element, click on it and then save it...that's far more than what is needed. I think this site uses an XML redirecting scheme in order to allow you to download the files. (The files are PDFs)



Edit: I figured out how to do it. I found the offending script which is in a URL and I added the URL to that script to Ad Blocker Plus, effectively blocking the execution of the code. While it's great that I solved my problem, it still doesn't address the issue of knowing how to block a script that is written into the webpage and so I'm still interested in knowing how to use greasemonkey to accomplish this task.
 

mechBgon

Super Moderator<br>Elite Member
Oct 31, 1999
30,699
1
0
In Internet Explorer, that would be possible using Internet Options > Security tab. You could modify the settings for the Internet zone so Scripting > Active Scripting is set to "Prompt." If it were me, I'd crank Trusted zone to Medium-High (like the Internet Zone), then modify Trusted's active-scripting setting and add the site to the Trusted zone, so you don't have to keep messing with the Internet Zone settings every time you want to use that site.
 

fleabag

Banned
Oct 1, 2007
2,450
1
0
Originally posted by: mechBgon
In Internet Explorer, that would be possible using Internet Options > Security tab. You could modify the settings for the Internet zone so Scripting > Active Scripting is set to "Prompt." If it were me, I'd crank Trusted zone to Medium-High (like the Internet Zone), then modify Trusted's active-scripting setting and add the site to the Trusted zone, so you don't have to keep messing with the Internet Zone settings every time you want to use that site.

Um, well I'm using Firefox and also while that idea seems sound, it turns out it doesn't work.. All it does is redirect to a blank page saying "restricted sites".. So much for that..
 

superjohnyo

Senior member
May 6, 2005
257
0
0
you can try using greasemonkey and creating your own script - if you know the javascript function that is doing the redirect then you can just create the same function name in a script and just leave it blank.
 

fleabag

Banned
Oct 1, 2007
2,450
1
0
Originally posted by: superjohnyo
you can try using greasemonkey and creating your own script - if you know the javascript function that is doing the redirect then you can just create the same function name in a script and just leave it blank.

I believe this is the script:
</script>


<script type="text/javascript" src="/t3Portal/staticcontent/js/t3StaticContentCommon.js"></script>



So how exactly would I block it with grease monkey?

I don't really understand how you would use greasemonkey to override scripts that are currently on the page. (I have it installed, just never have written for it and I have a limited time frame)

Tried to follow this:
http://www.dreamincode.net/forums/showtopic42646.htm

but with no luck. I'm totally unfamilar with javascript.