Дискусии » Заявки за създаване

Tampermonkey script to hide a html element on a specific website

§
Публикуван на: 20.09.2018
Редактиран на: 20.09.2018

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

§
Публикуван на: 27.09.2018

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。