Script Js
Script Js
// Version: 0.9.1
// Author: Wojciech Warpechowski (https://github.com/wojciesh)
// Source: https://github.com/wojciesh/YouTube-Anti-Anti-Adblock
// License: MIT
// Description:
// Simple Chrome Extension to remove anti-adblock on YouTube.
// Currently (16/10/2023) if YouTube finds an adblock, it shows a popup and pauses
the video.
// This script removes the popup and resumes the video.
function isAdblockPopup(popupContainer) {
return popupContainer?.classList.contains('ytd-app') &&
popupContainer.classList.contains('style-scope') &&
!!(popupContainer.querySelector('ytd-enforcement-message-view-model'));
}
function removePopup(popupContainer) {
popupContainer.remove();
log('Removed popup container');
}
function log(message) {
if (isDebug) console.log(`[YouTube Anti Anti-Adblock] ${message}`);
}