GoogleCleaner

try to save the world and remove google's privacy reminder

  1. // ==UserScript==
  2. // @name GoogleCleaner
  3. // @namespace org.free.world
  4. // @version 0.1.2
  5. // @description try to save the world and remove google's privacy reminder
  6. // @author You
  7. // @include /^https://w*\.?google\..*/
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13. window.onload = function () {
  14.  
  15.  
  16. var foundNode = contains('div', 'Hinweise zum Datenschutz');
  17. if(foundNode.length > 7)
  18. {
  19. console.log(foundNode);
  20. foundNode[7].parentNode.remove(foundNode[7]);
  21. }
  22.  
  23. var foundNodeEn = contains('div', 'privacy reminder');
  24. if(foundNodeEn.length > 7)
  25. {
  26. console.log(foundNodeEn);
  27. foundNodeEn[7].parentNode.remove(foundNodeEn[7]);
  28. }
  29.  
  30. }
  31. function contains(selector, text) {
  32. var elements = document.querySelectorAll(selector);
  33. return Array.prototype.filter.call(elements, function(element){
  34. return RegExp(text).test(element.innerText);
  35. });
  36. }
  37. })();