YoutubeAdblockMsgAutoDismiss

Youtube Adblock auto dismiss. For 2023/10 and further

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name            YoutubeAdblockMsgAutoDismiss
// @name:zh-tw      自動關閉Adblock提示
// @namespace       com.sherryyue.YoutubeAdblockMsgAutoDismiss
// @version         0.1
// @description     Youtube Adblock auto dismiss. For 2023/10 and further
// @description:zh-tw     自動關閉Adblock提示,應對2023/10版本
// @author          SherryYue
// @copyright       SherryYue
// @license         MIT
// @match           *://*.youtube.com/*
// @match           *://youtube.com/*

// @contributionURL https://sherryyuechiu.github.io/card
// @supportURL      [email protected]
// @icon            https://sherryyuechiu.github.io/card/images/logo/maskable_icon_x96.png
// @supportURL      "https://github.com/sherryyuechiu/GreasyMonkeyScripts/issues"
// @homepage        "https://github.com/sherryyuechiu/GreasyMonkeyScripts"
// @require         https://greasyfork.org/scripts/383527-wait-for-key-elements/code/Wait_for_key_elements.js?version=701631
// @grant           none
// ==/UserScript==

(function () {
  'use strict';
  waitForKeyElements('ytd-enforcement-message-view-model', () => {
    document.querySelector('ytd-enforcement-message-view-model').parentNode.parentNode.style.setProperty('display', 'none', 'important')
    document.querySelector('tp-yt-iron-overlay-backdrop').style.setProperty('display', 'none', 'important')
  })
})();