goog-no-reminder

Remove "A privacy reminder from Google" permanently

  1. // ==UserScript==
  2. // @author @leoncastro
  3. // @contributor @gnblizz; https://userstyles.org/styles/126125/google-don-t-bug-me
  4. // @license Public Domain; http://creativecommons.org/publicdomain/zero/1.0/
  5. // @namespace http://greasyfork.org
  6. // @name goog-no-reminder
  7. // @version 0.06
  8. // @description Remove "A privacy reminder from Google" permanently
  9. // @include /(https?:)?\/\/(www\.)?google\.((com)|((com?\.)?[\w]{2}))\/.*/
  10. // @include /(https?:)?\/\/(www\.)?youtube\.com\/.*/
  11. // @compatible firefox+greasemonkey
  12. // @compatible chrome
  13. // @compatible opera
  14. // @grant none
  15. // @run-at document-start
  16. // ==/UserScript==
  17. //
  18. !(function(){
  19.  
  20. function _addStyle(css)
  21. {
  22. var dad,obj;
  23. obj=document.createElement('style');
  24. obj.setAttribute('type','text/css');
  25. obj.innerHTML=css;
  26. dad=document.getElementsByTagName('head');
  27. (dad&&dad.length?dad[0]:document).appendChild(obj);
  28. }
  29. function onstart(fn){fn()}
  30. function onready(fn){(document.readyState!='loading')?fn():document.addEventListener('DOMContentLoaded',fn)}
  31.  
  32. var gg=/(https?:)?\/\/(www\.)?google\.((com)|((com?\.)?[\w]{2}))\/.*/,
  33. yt=/(https?:)?\/\/(www\.)?youtube\.com\/.*/;
  34.  
  35. if(gg.exec(location.href))
  36. {
  37. onstart(function(){
  38. _addStyle('#cnsh,#cnso,#cnsi{display:none!important}');
  39. });
  40. onready(function(){
  41. document.body.className=document.body.className.replace(/\bnsc\b/,'');
  42. });
  43. }
  44. else if(yt.exec(location.href))
  45. {
  46. onstart(function(){
  47. _addStyle('\
  48. .yt-consent,.yt-dialog-bg,#yt-consent-dialog{display:none!important}\
  49. .sitewide-consent-visible .yt-fragment-target{margin-top:-50px!important;padding-top:50px!important}\
  50. .appbar-hidden.sitewide-consent-visible #masthead-positioner-height-offset{height:50px!important}\
  51. .sitewide-consent-visible #masthead-positioner-height-offset{height:91px!important}\
  52. .sitewide-consent-visible #appbar-guide-menu{margin-top:50px!important}\
  53. ');
  54. });
  55. onready(function(){
  56. var b=window.top.document.querySelector('#body');
  57. if(b)
  58. {
  59. b.className=b.className.replace(/\bsitewide-consent-visible\b/,'');
  60. b.className=b.className.replace(/\byt-dialog-active\b/,'');
  61. }
  62. });
  63. }
  64.  
  65. })();