Skip to content

Instantly share code, notes, and snippets.

@WebDragon
Last active July 14, 2024 14:43
Show Gist options
  • Save WebDragon/dc4fa0f45661eccc4be138cacb2a4c9f to your computer and use it in GitHub Desktop.
Save WebDragon/dc4fa0f45661eccc4be138cacb2a4c9f to your computer and use it in GitHub Desktop.
Use Stylus to highlight which lines in your email are now Ads in Gmail, so you are less likely to click on them accidentally but still can go view the ad if you want.

Ads! In my Gmail! Mixed in with the rest?! Hooligans!

So I used this little chrome extension called Stylus to add a style to any mail.google.com/* domain, which subsequently fixes that problem for me by highlighting the sponsored links in such a way that I won't accidentally click on them, while they're mixed in randomly with my email.

https://chromewebstore.google.com/detail/stylus/clngdbkpkpeebahjckkjfobafhncgmne?pli=1

tr:has( td > div.yW span.aPd ), 
tr:has( td > div.yW span.ast ) {
    background: palevioletred;
}

which will, obviously, work until google changes the classes being used to identify them, but hey, it works for now. And at least now I'm far less likely to click them accidentally and can CHOOSE to if I want. If they're gonna try and generate ad revenue from me, it had damn well better be relevant to my interests.

Stylus rocks. Don't leave /home without it :)

I will attempt to keep the above css updated as frequently as google changes these classes, and what is shown above should be always used in preference to that in the example image in my comment below.

last revised: 2024-06-26

@WebDragon
Copy link
Author

image

@WebDragon
Copy link
Author

one for Yahoo mail too:

@-moz-document domain("mail.yahoo.com") {
    li.H_A:has([data-test-id="pencil-ad-messageList"]) {  
        border: 4px solid palevioletred !important; 
        background-color: palevioletred}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment