Skip to content

Instantly share code, notes, and snippets.

@codesorter2015
codesorter2015 / skipAds.js
Created August 23, 2019 06:46
How to automatically skip youtube Ads using puppeteer?
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({headless:false});
const page = await browser.newPage();
let url = 'youtube url';
await page.goto(url);
await page.evaluate(() => {
self.moHandler = {
changesObserver: function (mutation) {
if (mutation.type === 'attributes'){