CSS: google.com

Corrections to UI of google.com

  1. // ==UserScript==
  2. // @name CSS: google.com
  3. // @description Corrections to UI of google.com
  4. // @author MK
  5. // @namespace max44
  6. // @homepage https://greasyfork.org/en/users/309172-max44
  7. // @match *://www.google.com/*
  8. // @match *://google.com/*
  9. // @version 0.1
  10. // @license MIT
  11. // @require https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
  12. // @run-at document-idle
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18. /*Hide text in buttons to make cache button visible in mobile browsers*/
  19. const rootCallback = function (mutationsList, observer) {
  20. var button = $( "div.u0G9Kc > div > a > span > span:nth-child(2)" );
  21. if (button != null && button.length > 0) {
  22. for (var i = 0; i < button.length; i++) {
  23. if (button[i].innerHTML != " ") {
  24. button[i].innerHTML = " ";
  25. }
  26. }
  27. }
  28. }
  29.  
  30. const rootNode = document.querySelector("body");
  31. if (rootNode != null) {
  32. const rootObserver = new MutationObserver(rootCallback);
  33. rootObserver.observe(rootNode, {childList: true, subtree: true});
  34. }
  35. })();