Skip to content
This repository has been archived by the owner on Sep 28, 2024. It is now read-only.

Commit

Permalink
Updated new scroll stuff and adblocker puts the ads to 0 volume
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRealJoelmatic authored Oct 18, 2023
1 parent aae55ef commit caee65e
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions Youtube-Ad-blocker-Reminder-Remover.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,32 @@
removeJsonPaths(domainsToRemove, jsonPathsToRemove);
setInterval(() => {

const modalOverlay = document.querySelector("tp-yt-iron-overlay-backdrop");
const popup = document.querySelector(".style-scope ytd-enforcement-message-view-model");
const popupButton = document.getElementById("dismiss-button");
const popupButton2 = document.getElementById("ytp-play-button ytp-button");

const video1 = document.querySelector("#movie_player > video.html5-main-video");
const video2 = document.querySelector("#movie_player > .html5-video-container > video");

const modalOverlay = document.querySelector("tp-yt-iron-overlay-backdrop");
const bodyStyle = document.body.style;

bodyStyle.setProperty('overflow', 'scroll', 'important');

if (modalOverlay){
modalOverlay.removeAttribute("opened");
modalOverlay.remove();
}

if (popup) {
document.getElementById("dismiss-button").click();
document.getElementsByClassName("ytp-play-button ytp-button")[0].click();


if (debug) console.log("Remove Adblock Thing: Popup detected, removing...");

if(popupButton) popupButton.click();
if(popupButton2) popupButton2.click();
popup.remove();
if (modalOverlay) modalOverlay.removeAttribute("opened");
unpausedAfterSkip = 2;

if (debug) console.log("Remove Adblock Thing: Popup removed");
}

Expand Down Expand Up @@ -107,12 +118,12 @@
if (ad)
{
document.querySelector('video').playbackRate = 10;
document.querySelector('video').volume = 0;
if(skipBtn)
{
skipBtn.click();
}
}

if (sidAd)
{
sidAd.remove();
Expand Down

0 comments on commit caee65e

Please sign in to comment.