Please help with custom filter

Discussion in 'Custom Filters' started by Vadim Bryksin, Jul 11, 2018.

  1. Vadim Bryksin

    Vadim Bryksin New Member

    Joined:
    Jul 11, 2018
    Messages:
    2
    Hi Guys

    I went through the official documentation on custom filters but it is somewhat head breaking...

    Here is the problem:
    The site started showing ads, and <div>'s are with random ID's each refresh, so it is not possible to block HTML element simple as that, however, after inspecting the code of the element I noticed that all adds are using pictures in Base64 data format, so I figured out Xpath with regex to find those elements, and it works,
    but now im not getting how to incorporate this regex with the domain

    here is xpath:
    Code:
    //*[contains(@style, 'url("data:image/png;base64,')]/parent::*/../..
    So we are looking for any element, where style has base64 image and 3 parents up from it

    How do I do Rule with that?
     
  2. Alex302

    Alex302 Filters Developer Staff Member Administrator

    Joined:
    Jul 20, 2012
    Messages:
    24,238
    Hi
    I need to see the real example.
    Xpath is not supported by AdGuard.
     
  3. Vadim Bryksin

    Vadim Bryksin New Member

    Joined:
    Jul 11, 2018
    Messages:
    2
    This is the site:
    https://crackwatch.com/

    I know AdGuard doesn't support xpath, but it does support regex and I have regex incorporated into my xpath so I was thinking it would be possible to translate it
     
  4. Alex302

    Alex302 Filters Developer Staff Member Administrator

    Joined:
    Jul 20, 2012
    Messages:
    24,238
    Added
    Code:
    crackwatch.com#$#div[style$="text-align: center;"] > div > a[rel="nofollow noopener noreferrer"] > span { height: 1px!important; min-height: 1px!important; background-image: none!important; }