Advertisement
FatalBulletHit

[Tampermonkey] YouTube Music - Skip Harmful Content Warning

Feb 18th, 2023 (edited)
1,036
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         YouTube Music - Skip Harmful Content Warning
  3. // @version      1.0
  4. // @description  Automatically skips the Harmful Content Warning on YouTube Music by confirming the prompt
  5. // @author       FatalBulletHit
  6. // @match        http*://*.youtube.com/watch*
  7. // @icon         https://www.google.com/s2/favicons?sz=64&domain=youtube.com
  8. // @grant        none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12.     'use strict';
  13.  
  14.     // Your code here...
  15.     const buttonCollection = document.getElementsByTagName('button');
  16.     const harmWarningButton = Object.values(buttonCollection).filter(x => x.textContent == "I understand and wish to proceed");
  17.     harmWarningButton[0].click();
  18.  
  19. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement