Skip to content

Instantly share code, notes, and snippets.

View codesorter2015's full-sized avatar
🏠
Working from home

Krish codesorter2015

🏠
Working from home
View GitHub Profile
@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'){