討論 » 建立請求

Tampermonkey script to hide a html element on a specific website

§
發表於:2018-09-20
編輯:2018-09-20

Tampermonkey script to hide a html element on a specific website

Dear community,

I enabled the redesigned "New Tab page" (chrome://newtab) in Google Chrome (chrome://flags/#ntp-backgrounds). Everything was fine and the new design looks very nice, until a distracting and irritating animated button showed up next to the Google logo, this is its html element id:

<a id="ctDoodleNotifier" title="Hier klicken, um das heutige Doodle zu sehen" style="cursor: pointer;" class="__web-inspector-hide-shortcut__"><doodle-notifier></doodle-notifier></a>

Can someone write a script to hide this element on the website chrome://newtab ? Thank you!

Best regards, PeterCo

§
發表於:2018-09-27

Tampermonkey will not work on the newtab page in the recent chrome,neither the other extensions unless it overwrite the newtab page.The follow style may work if you can make some extensions work on the newtab page

a#ctDoodleNotifier{display:none;}

or the follow scripts

// ==UserScript==
// @name         block ctDoodleNotifier of newtab
// @namespace    http://tampermonkey.net/
// @version      0.1
// @include      chrome://newtab*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    const style = document.createElement('style');
    style.type = 'text/css';
    style.innerText = 'a#ctDoodleNotifier{display:none;}';
    document.head.appendChild(style);
})();

發表回覆

登入以回覆

长期地址
遇到问题?请前往 GitHub 提 Issues。