goog-no-reminder

Remove "A privacy reminder from Google" permanently

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @author       @leoncastro
// @contributor  @gnblizz; https://userstyles.org/styles/126125/google-don-t-bug-me
// @license      Public Domain; http://creativecommons.org/publicdomain/zero/1.0/
// @namespace    http://greatest.deepsurf.us
// @name         goog-no-reminder
// @version      0.06
// @description  Remove "A privacy reminder from Google" permanently
// @include      /(https?:)?\/\/(www\.)?google\.((com)|((com?\.)?[\w]{2}))\/.*/
// @include      /(https?:)?\/\/(www\.)?youtube\.com\/.*/
// @compatible   firefox+greasemonkey
// @compatible   chrome
// @compatible   opera
// @grant        none
// @run-at       document-start
// ==/UserScript==
//
!(function(){

 function _addStyle(css)
 {
  var dad,obj;
  obj=document.createElement('style');
  obj.setAttribute('type','text/css');
  obj.innerHTML=css;
  dad=document.getElementsByTagName('head');
  (dad&&dad.length?dad[0]:document).appendChild(obj);
 }
 function onstart(fn){fn()}
 function onready(fn){(document.readyState!='loading')?fn():document.addEventListener('DOMContentLoaded',fn)}

 var gg=/(https?:)?\/\/(www\.)?google\.((com)|((com?\.)?[\w]{2}))\/.*/,
     yt=/(https?:)?\/\/(www\.)?youtube\.com\/.*/;

 if(gg.exec(location.href))
 {
  onstart(function(){
   _addStyle('#cnsh,#cnso,#cnsi{display:none!important}');
  });
  onready(function(){
   document.body.className=document.body.className.replace(/\bnsc\b/,'');
  });
 }
 else if(yt.exec(location.href))
 {
  onstart(function(){
   _addStyle('\
    .yt-consent,.yt-dialog-bg,#yt-consent-dialog{display:none!important}\
    .sitewide-consent-visible .yt-fragment-target{margin-top:-50px!important;padding-top:50px!important}\
    .appbar-hidden.sitewide-consent-visible #masthead-positioner-height-offset{height:50px!important}\
    .sitewide-consent-visible #masthead-positioner-height-offset{height:91px!important}\
    .sitewide-consent-visible #appbar-guide-menu{margin-top:50px!important}\
   ');
  });
  onready(function(){
   var b=window.top.document.querySelector('#body');
   if(b)
   {
    b.className=b.className.replace(/\bsitewide-consent-visible\b/,'');
    b.className=b.className.replace(/\byt-dialog-active\b/,'');
   }
  });
 }

})();