src/youtube/music/warning-proceed.user.js created
This commit is contained in:
parent
3cab1d9b59
commit
5055253cd3
2 changed files with 26 additions and 0 deletions
8
src/youtube/music/warning-proceed.meta.js
Normal file
8
src/youtube/music/warning-proceed.meta.js
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
// ==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 {{FILE_URL}}
|
||||||
|
// @version {{UNIXDATE}}
|
||||||
|
// ==/UserScript==
|
18
src/youtube/music/warning-proceed.user.js
Normal file
18
src/youtube/music/warning-proceed.user.js
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
(function () {
|
||||||
|
let errorScreenEl = document.querySelector("#error-screen");
|
||||||
|
console.log({ errorScreenEl: errorScreenEl });
|
||||||
|
let reasonEl = errorScreenEl.querySelector("#reason");
|
||||||
|
console.log({ reasonEl: reasonEl });
|
||||||
|
if (
|
||||||
|
reasonEl.textContent ===
|
||||||
|
"The following content may contain suicide or self-harm topics."
|
||||||
|
) {
|
||||||
|
let buttonEl = errorScreenEl.querySelector(
|
||||||
|
'button[aria-label="I understand and wish to proceed"]'
|
||||||
|
);
|
||||||
|
console.log({ buttonEl: buttonEl });
|
||||||
|
if (buttonEl) {
|
||||||
|
buttonEl.click();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})();
|
Loading…
Reference in a new issue