Blocking some types of animation

Ask for help about NoScript, no registration needed to post
wakkamole

Blocking some types of animation

Post by wakkamole »

I want to block a JS animation. The site triggers your antispam filter so I can't actually post the URL... so... uhh... Well, anyway it's the top hit in a duckduckgo search for: azithromycin action

About 1/8th the way down the page on the right side. It's a smooth scrolling box. I've seen this kind of ad/attention grab on several sites and want to filter it off. Disabling all scripts globally works but I was hoping for a more fine-tuned approach. Thanks for any help here!
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0
barbaz
Senior Member
Posts: 11067
Joined: Sat Aug 03, 2013 5:45 pm

Re: Blocking some types of animation

Post by barbaz »

This URL?

Code: Select all

http://www.rxlist.com/zithromax-drug/clinical-pharmacology.htm
I don't randomly allow scripts on random sites.
So if that's it, is the animated part the "Popular Collections" sidebar element on the right?

BTW, one possible approach to zap it is a custom surrogate script.
*Always* check the changelogs BEFORE updating that important software!
-
wakkamole

Re: Blocking some types of animation

Post by wakkamole »

Yes that is the site and the animated graphic I'd like to block.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0
User avatar
Thrawn
Master Bug Buster
Posts: 3106
Joined: Mon Jan 16, 2012 3:46 am
Location: Australia
Contact:

Re: Blocking some types of animation

Post by Thrawn »

The simplest approach is to remove the entire box from the page.
  1. Open a new tab and go to about:config. This will warn you that what you're doing is dangerous (which is true; follow instructions carefully!).
  2. Right-click anywhere on the page and select New - String.
    • Name: noscript.surrogate.rxlist.sources
    • Value: !@.rxlist.com
    This tells NoScript to apply a surrogate to rxlist.com and all subdomains, before running any other scripts.
  3. Right-click again and add another string value.
    • Name: noscript.surrogate.rxlist.replacement
    • Value: var demoBox = document.getElementById('demo_container'); demoBox.parentNode.removeChild(demoBox);
      This tells NoScript to remove the element named 'demo_container' from the page.
Last edited by barbaz on Mon Sep 28, 2015 11:17 pm, edited 1 time in total.
Reason: fix typo in surrogate value (prefix was backwards)
======
Thrawn
------------
Religion is not the opium of the masses. Daily life is the opium of the masses.

True religion, which dares to acknowledge death and challenge the way we live, is an attempt to wake up.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0
Post Reply