UserScriptsPublic/build/youtube/music/warning-proceed.user.js
2024-08-03 15:07:32 +00:00

30 lines
1,005 B
JavaScript

// ==UserScript==
// @name music.youtube.com
// @description This skips the warning "The following content may contain suicide or self-harm topics." on music.youtube.com
// @namespace Bowud Scripts
// @match https://music.youtube.com/watch*
// @downloadURL https://git.bowu.dev/bowu/UserScriptsPublic/raw/branch/main/build/youtube/music/warning-proceed.user.js
// @version 1722697632361
// ==/UserScript==
"use strict";
setInterval(function () {
var errorScreenEl = document.querySelector("#error-screen");
console.log({
errorScreenEl: errorScreenEl
});
var reasonEl = errorScreenEl.querySelector("#reason");
console.log({
reasonEl: reasonEl
});
if (reasonEl.textContent === "The following content may contain suicide or self-harm topics.") {
var buttonEl = errorScreenEl.querySelector('button[aria-label="I understand and wish to proceed"]');
console.log({
buttonEl: buttonEl
});
if (buttonEl) {
buttonEl.click();
}
}
}, 100);