Skip to content
This repository was archived by the owner on Dec 24, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Youtube-Ad-blocker-Reminder-Remover.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
// Fix timestamps in the youtube comments for new method
const fixTimestamps = true;

// Fix The blocker element in the youtube playback
const curtainBlockerFix = true;

// Enable custom modal
// Uses SweetAlert2 library (https://cdn.jsdelivr.net/npm/sweetalert2@11) for the update version modal.
// When set to false, the default window popup will be used. And the library will not be loaded.
Expand Down Expand Up @@ -77,6 +80,7 @@
if (removePopup) popupRemover();
if (updateCheck) checkForUpdate();
if (fixTimestamps) timestampFix();
if (curtainBlockerFix) curtainBlockerRemove();

// Remove Them pesski popups
function popupRemover() {
Expand Down Expand Up @@ -368,6 +372,18 @@
});
}

function curtainBlockerRemove() {
setInterval(() => {
const element = document.querySelector(
"ytd-watch-flexy[player-unavailable]"
);

if (element) {
element.removeAttribute("player-unavailable");
}
}, 1000);
}

function observerCallback(mutations) {
let isVideoAdded = mutations.some(mutation =>
Array.from(mutation.addedNodes).some(node => node.tagName === 'VIDEO')
Expand Down