Skip to content

Instantly share code, notes, and snippets.

@rzfury
Last active October 5, 2023 13:25
Show Gist options
  • Save rzfury/5f95166cfac2d16d5df49935908d1a00 to your computer and use it in GitHub Desktop.
Save rzfury/5f95166cfac2d16d5df49935908d1a00 to your computer and use it in GitHub Desktop.
Immediately remove youtube adblock popup and play the video.
// ==UserScript==
// @name Fuck Youtube Adblock
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author RZFury
// @match https://www.youtube.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @updateURL https://gist.githubusercontent.com/rzfury/5f95166cfac2d16d5df49935908d1a00/raw/98261282a19b2f74de51bf4239583b58b66025b1/yt-no-adblock-popup.js
// @downloadURL https://gist.githubusercontent.com/rzfury/5f95166cfac2d16d5df49935908d1a00/raw/98261282a19b2f74de51bf4239583b58b66025b1/yt-no-adblock-popup.js
// @grant none
// ==/UserScript==
(function() {
'use strict';
setInterval(() => {
const popup = document.querySelectorAll('ytd-popup-container')[0];
if(popup && popup.textContent.includes(__RZF_lang())) {
popup.remove();
setTimeout(() => {
document.querySelector('button[aria-keyshortcuts="k"]').click()
}, 100);
}
}, 100);
// Your code here...
})();
function __RZF_lang() {
switch(document.documentElement.lang) {
case 'id-ID':
case 'id':
return 'Pemblokir';
default:
return 'Adblock';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment