Greasy Fork is available in English.

Auto Agree+Skip YouTube Consent/Sign-in Pages

Automatically click on the "I Agree" button on YouTube's consent page, the "No thanks" link on YouTube's sign-in popup, or the "I understand and wish to proceed" button on YouTube's video page.

< Commentaires sur Auto Agree+Skip YouTube Consent/Sign-in Pages

Avis: Bon - le script fonctionne correctement

§
Posté le: 13/09/2022

Could you also implement this into the code?

if (a = document.querySelector('tp-yt-paper-button[aria-label="I understand and wish to proceed"]')) a.click();

I would go above/below the No Thanks button

Its to autoclick the I understand button when trying to watch something with "graphic" content

jcunewsAuteur
§
Posté le: 13/09/2022

Could you post the URL where that code is applicable? So that I could test it from my system.

§
Posté le: 13/09/2022

https://www.youtube.com/watch?v=pvUiMnHc51Y

Its hard to find examples sometimes but This channel should have a bunch of them, I think Real World Police might have some as well but I will also see it on some of the older documentaries or real crime shows.

jcunewsAuteur
§
Posté le: 13/09/2022

Thank you. Although not exactly the same, the suggested solution has been implemented into the script.

§
Posté le: 13/09/2022

As long as it works I am happy. Would rather use your original script instead of having to manually patch it after each update.

§
Posté le: 01/01/2023
Édité le: 01/01/2023

Hey, I came for the "I understand i wish to proceed" feature i was looking so much for but After installing it, I realized that it isn't working as expected. It doesn't click on the button.

I tried the following videos in both firefox and google chrome:
- https://www.youtube.com/watch?v=pvUiMnHc51Y (the link provided by JRemi)
- https://www.youtube.com/watch?v=mVjyVppveGY (the music i want listen to)

btw, thank you for creating this script, i was about to create mine and had no idea of how to start or what to do.

§
Posté le: 01/01/2023
Édité le: 01/01/2023

Hey, I came for the "I understand i wish to proceed" feature i was looking so much for but After installing it, I realized that it isn't working as expected. It doesn't click on the button.

I tried the following videos in both firefox and google chrome:
- https://www.youtube.com/watch?v=pvUiMnHc51Y (the link provided by JRemi)
- https://www.youtube.com/watch?v=mVjyVppveGY (the music i want listen to)

btw, thank you for creating this script, i was about to create mine and had no idea of how to start or what to do.

I added a case for music.youtube (it didn't appear as enabled in yt music) and changed/added a query selector. Please update this to the source code, (it worked :D).

((a, t) => {

  const waitTime = 10; //how many seconds to wait for any sign-in popup to appear after fresh-loading a web page

  switch (location.hostname) { // hostname or domain of current page.
    case "consent.youtube.com": if (a = document.querySelector('[type="submit"]')) {a.click();} break;
    case "www.music.youtube.com":
    case "www.youtube.com":
      addEventListener("load", h => { //set event listener for the "load" event
        t = (new Date).getTime();
        h = setInterval(() => { //set timer and will execute the code within the timer at regular intervals (100 milliseconds in this case). The timer will continue to run until it has been running for the number of seconds specified by waitTime
          if (a = document.querySelector(
            'yt-upsell-dialog-renderer tp-yt-paper-button[aria-label="No thanks"],'+
'.yt-player-error-message-renderer tp-yt-paper-button[aria-label="I understand and wish to proceed"],'+
'.yt-spec-button-shape-next.yt-spec-button-shape-next--filled.yt-spec-button-shape-next--overlay.yt-spec-button-shape-next--size-m'
          )) {a.click();}
          // yt-spec-touch-feedback-shape__fill
          if (((new Date).getTime() - t) > (waitTime * 1000)) clearInterval(h)
        }, 100);
      })
      break;
  }
})()

Poster une réponse

Connectez-vous pour poster une réponse.