您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Get rid of Google Doodle logos and link
当前为
- // ==UserScript==
- // @name No Google Doodle
- // @namespace https://github.com/Procyon-b
- // @version 0.6.1
- // @description Get rid of Google Doodle logos and link
- // @author Achernar
- // @include https://www.google.tld/
- // @include https://www.google.tld/?*
- // @include https://www.google.tld/webhp*
- // @run-at document-start
- // @grant none
- // ==/UserScript==
- (function() {
- "use strict";
- var logo, outer=false, fixed=false, style='#replacedDoodle ~ div, #replacedDoodle ~ canvas {display:none;}';
- var st=document.createElement("style");
- st.textContent='#hplogo > *:not(#replacedDoodle), a > img#hplogo {display: none;}'+style;
- try{document.head.appendChild(st);}catch(e){}
- if (document.readyState != 'loading') fix();
- else {
- document.addEventListener('DOMContentLoaded', function(){
- obs.disconnect();
- fix();
- });
- const obs = new MutationObserver(function(muts){
- for (let mut of muts) {
- for (let n of mut.addedNodes) {
- if (n.classList && n.classList.contains('o3j99')) {
- if (n.querySelector('#hplogo')) {
- this.disconnect();
- fix();
- return;
- }
- }
- }
- }
- });
- obs.observe(document, { attributes: false, childList: true, subtree: true});
- }
- function fix() {
- if ( (document.title!='Google') || fixed ) return;
- fixed=true;
- logo=document.querySelector('div#hplogo');
- if (!logo) {
- if (logo = document.querySelector('a > img#hplogo')) {
- logo=logo.parentNode;
- outer=true;
- }
- }
- if (logo) {
- let h='<img id="replacedDoodle" style="bottom:0;position:absolute;left:50%;transform:translate(-50%);" src="/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png"><style>'+style+'</style>';
- if (outer) logo.outerHTML=h;
- else logo.innerHTML=h;
- setTimeout(function(){
- var a=document.querySelectorAll('#replacedDoodle ~ :not(style)');
- a.forEach(function(e){ e.remove(); });
- }, 300);
- }
- else {
- st.remove();
- }
- }
- })();