Results 1 to 4 of 4

Thread: Any way to selectively disable a single javascript function without disabling all JS?

  1. #1

    Default Any way to selectively disable a single javascript function without disabling all JS?

    I have a large set of documents where each page has a retarded script that detects whether or not it's in a frame, and if it decides it's not it tries to redirect to a frameset document that doesn't exist (each page tries to redirect to a different frameset, so I can't just create a single bogus document to solve the problem). Unfortunately, the documents all require javascript to be enabled in order to be of any great use to me, so I can't just disable all javascript functionality.

    Is there any way to easily disable just the redirection function eg. using a greasemonkey script or an addon? Any ideas?
    "One day, we shall die. All the other days, we shall live."

  2. #2
    I don't know the answer because I stopped taking Java in college, but I assume these documents are HTML files? Or being read in something that's not a conventional browser?

  3. #3
    Let sleeping tigers lie Khendraja'aro's Avatar
    Join Date
    Jan 2010
    Location
    In the forests of the night
    Posts
    6,239
    Quote Originally Posted by Dreadnaught View Post
    I don't know the answer because I stopped taking Java in college, but I assume these documents are HTML files? Or being read in something that's not a conventional browser?
    First, Javascript != Java. Secondly:

    http://www.mozilla.org/projects/secu...figPolicy.html

    Which means that something like this should render redirects for that particular site useless:

    Code:
    user_pref("capability.policy.policynames", "strict");
       user_pref("capability.policy.strict.sites", "http://www.annoying.com");
       user_pref("capability.policy.strict.Window.location.href", "noAccess");
    You may have to tinker a bit with the last line, depending on which Javascript function is actually used.

    Those are put into the user preferences of Firefox: https://developer.mozilla.org/En/A_B...nces#modifying
    When the stars threw down their spears
    And watered heaven with their tears:
    Did he smile his work to see?
    Did he who made the lamb make thee?

  4. #4
    Wow, that's pretty much exactly what I'm looking for, thanks! I just don't seem to be able to get it to work on locally hosted files (spidered the site in question in order to be able to use it when I don't have a connection, ie. most of the time when I'm in another town ). The battle continues...
    "One day, we shall die. All the other days, we shall live."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •