Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Paco Hope #resist
@paco@infosec.exchange  ·  activity timestamp 2 days ago

I just learned how to do some uBlock origin cosmetic selectors to remove elements on the page that invite me to use AI or take up screen real estate offering pointless AI summaries.

So many web sites use auto-generated CSS class names that you can't match on the actual classes. And you can't be sure that it will actually be 3 <div>s from the root or anything like that.

What I really like is the :upward() selector. I can basically match something like <h3>Try our assistant</h3> and then append :upward(3) to tell uBlock that regardless of what their names are, block the entire div 3 levels up because I found the matching text down here.

One of the things I'm hiding is a graphical button, so I use its aria-label to match it.

Here's some examples:

example.com##.genaiPageSummaryButton:upward(8)

example.com##span:has-text("Open the Assistant"):upward(3)

example.com##a[aria-label="Open automated answers"]:upward(2)
  • Copy link
  • Flag this post
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0-rc.3.21 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login