Skip to content

Instantly share code, notes, and snippets.

@szepeviktor
Last active August 21, 2020 07:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save szepeviktor/83f8f1f12a10fb17bc222710d50b4452 to your computer and use it in GitHub Desktop.
Save szepeviktor/83f8f1f12a10fb17bc222710d50b4452 to your computer and use it in GitHub Desktop.
Google Search ads old green style
// ==UserScript==
// @name Google Search old green ads
// @description Mark ads with green "Ad" tag
// @author https://gist.github.com/szepeviktor/83f8f1f12a10fb17bc222710d50b4452
// @icon https://www.google.com/favicon.ico
// @version 0.7.0
// @grant none
// @run-at document-idle
// @include https://www.google.*/search?*
// ==/UserScript==
let styleSheet = document.createElement("style");
styleSheet.type = "text/css";
// Add green background, hide dot + Alternative (w-visurl element)
styleSheet.innerHTML =
"[aria-label='Ads'] li a[data-ved] > div:not([aria-level]) > span:first-child { background-color: #59946B; color: white; border-radius: 5px; padding: 0 5px; margin-right: 4px; }"
+ "[aria-label='Ads'] li a[data-ved] > div:not([aria-level]) > span:first-child > span { display: none; }"
+ "[aria-label='Ads'] li a[data-ved] > w-visurl > div > span:first-child { background-color: #59946B; color: white; border-radius: 5px; padding: 0 5px; margin-right: 4px; }"
+ "[aria-label='Ads'] li a[data-ved] > w-visurl > div > span:first-child > span { display: none; }";
document.body.appendChild(styleSheet);
@szepeviktor
Copy link
Author

kép

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