Skip to content

Instantly share code, notes, and snippets.

@David256
Last active July 3, 2021 02:38
Show Gist options
  • Save David256/add61ae91d00a63bcb9e74f3a9ae62fe to your computer and use it in GitHub Desktop.
Save David256/add61ae91d00a63bcb9e74f3a9ae62fe to your computer and use it in GitHub Desktop.
Script skips ads automatic in YouTube
/**
* Ad Skip Script - Javascript
*/
/**
* Ad Skip Script - Javascript
*/
let d = document;
let t = 1000;
let e = document.createEvent("HTMLEvents");
e.initEvent("click", true, true);
let fad = () => {
let b = d.querySelector(".ytp-ad-skip-button.ytp-button");
let x = d.querySelector(".ytp-ad-overlay-close-container");
t = 1000;
if (b) b.dispatchEvent(e);
else if (x) x.dispatchEvent(e);
else t = 100;
setTimeout(fad, t);
}
setTimeout(fad, t);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment