goog-no-reminder

Remove "A privacy reminder from Google" permanently

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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://greasyfork.org
// @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/,'');
   }
  });
 }

})();