Block "script" for all (not just first-party/direct)?

Discussion in 'Custom Filters' started by SouthernDevGirl, Apr 20, 2019.

  1. SouthernDevGirl

    SouthernDevGirl New Member

    Joined:
    Apr 18, 2019
    Messages:
    11
    When blocking javascript, for example:

    ||example.com^$script (0r) ||example.com^$script,important

    I notice the third-party Javascript continues to run. This has created problems for me, because most scripts come from third-party locations. As a result, blocking "script" doesn't do much in my use-cases.

    I'm betting there is a simple rule that blocks everything, not only the local resources within a rule, and I'm just not aware of it?

    Thank you in advance!
     
  2. Blaz

    Blaz Moderator & Translator Staff Member Moderator

    Joined:
    Dec 21, 2014
    Messages:
    9,736
    If you want to block all scripts (first and third-party), just use this rule:

    Code:
    ||*.*$script
    
    Please note you will get a lot of broken sites then.
     
  3. SouthernDevGirl

    SouthernDevGirl New Member

    Joined:
    Apr 18, 2019
    Messages:
    11
    Sorry, it looks like I did a bad job explaining ..

    I don't want to block all sites, if I did, I would certainly use a wildcard like you mentioned (or just avoid browsing altogether, lol).

    Let me clarify...

    If I block a specific page or domain, for example:

    ||example.com^$script

    This apparantly does not block the javascript called from third-party sites from the site being blocked. In other words, it apparently only blocks javascript from example.com in my testing.

    What I'd like to do, is understand how to block all script, whether it's first-party or third-party.
     
  4. Blaz

    Blaz Moderator & Translator Staff Member Moderator

    Joined:
    Dec 21, 2014
    Messages:
    9,736
    ||*.*^$script,domain=example.com

    This rule will block every script which is requested from the site example.com (unless something removes referrer).
     
    SouthernDevGirl likes this.
  5. SouthernDevGirl

    SouthernDevGirl New Member

    Joined:
    Apr 18, 2019
    Messages:
    11
    That's perfect, thank you!

    I knew it must be something simple that was staring me in the face!