Greasy Fork is available in English.

Google Search disable Google's video player

Disable Google's video player in Google search

  1. // ==UserScript==
  2. // @name Google Search disable Google's video player
  3. // @namespace https://greasyfork.org/en/users/85671-jcunews
  4. // @version 1.0.3
  5. // @license AGPL v3
  6. // @author jcunews
  7. // @description Disable Google's video player in Google search
  8. // @match https://google.*/search*
  9. // @match https://google.*.*/search*
  10. // @match https://www.google.*/search*
  11. // @match https://www.google.*.*/search*
  12. // @grant none
  13. // @run-at document-start
  14. // ==/UserScript==
  15.  
  16. /*
  17. Initially posted on Reddit:
  18.  
  19. https://www.reddit.com/r/userscripts/comments/10kvlb4/go_to_youtube_from_google_by_clicking_on_the/j5udys2/
  20.  
  21. Released in GreasyFork as suggested by a Reddit user, and with code modification based on the suggested code.
  22.  
  23. https://www.reddit.com/user/changePOURchange
  24. */
  25.  
  26. (() => {
  27. addEventListener("mouseover", (ev, viewerSelector, urlSelector, thumbLink, resEle) => {
  28. viewerSelector = 'a[data-vll]';
  29. urlSelector = '[data-surl]';
  30. if ((thumbLink = ev.target.closest(viewerSelector)) && (resEle = thumbLink.closest(urlSelector))) {
  31. delete thumbLink.dataset.vll;
  32. thumbLink.href = resEle.dataset.surl
  33. }
  34. }, true)
  35. })()