Questions

  1. Is there an add-on that allows me to do the following?

  2. What’s a very easy way to do the following via programming? js or whatever.

-–

I want to delete or hide a HTML section that has specific text. Using regex on the source HTML is quick, dirty, and ugly but is there another very easy way? There isn’t - is there?

The thumb is an example. I want the Christmas shit gone.

So - if \b(Christmas)\b is in a TR then hide or delete it.

Quick/dirty is key. And I don’t want to spend untold hours trying to learn and then failing to learn how to programmatically do it the right way. I know regex can be a nightmare but I want to do be able to do the removal/hiding at other sites too.

I don’t see another way to reuse this method on any site. [Edit: That was confusing.]

  • InevitableSwing [none/use name]@hexbear.netOP
    link
    fedilink
    English
    arrow-up
    1
    ·
    28 days ago

    Thanks.

    It will slow down your browser on every page…

    Do they mean every page on example.com or every page I visit on the net?

    Forward slashes like :has-text(/Target words/) are not needed. If you use them, the expression inside will be evaluated as RegEx which will cause even more workload.

    Heh.

    • Ekranoplane [none/use name]@hexbear.net
      link
      fedilink
      English
      arrow-up
      2
      ·
      28 days ago

      By default ublock won’t want to apply this type of filter to every page, just the pages of whatever site you make the rule for. That’s why the second comment is talking about going into advanced settings to enable it globally. If you do that it will slow down EVERY page. It might not be noticeable, depends on your hardware.

      • InevitableSwing [none/use name]@hexbear.netOP
        link
        fedilink
        English
        arrow-up
        1
        ·
        28 days ago

        Thanks. Ah.

        going into advanced settings to enable it globally

        I’ll leave that off. I don’t want to create unneeded headaches for myself. Per site is fine. Sorry to waste your time. I should have thought more and read more before insta-posting in worry. Actually - I should always do that. But that’s another story.