mirror of
https://github.com/goodtube4u/goodtube.git
synced 2025-11-22 10:16:11 +00:00
Re-add endscreen thumbnails
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @name GoodTube
|
||||
// @namespace http://tampermonkey.net/
|
||||
// @version 2.012
|
||||
// @version 2.013
|
||||
// @description Removes 100% of Youtube ads.
|
||||
// @author GoodTube
|
||||
// @updateURL https://github.com/goodtube4u/goodtube/raw/refs/heads/main/goodtube.user.js
|
||||
@@ -1938,10 +1938,48 @@
|
||||
// Fix fullscreen button issues
|
||||
goodTube_iframe_fixFullScreenButton();
|
||||
|
||||
// Fix end screen links
|
||||
goodTube_iframe_fixEndScreenLinks();
|
||||
|
||||
// Run actions again in 100ms to loop this function
|
||||
setTimeout(goodTube_iframe_actions, 100);
|
||||
}
|
||||
|
||||
// Fix end screen links (so they open in the same window)
|
||||
function goodTube_iframe_fixEndScreenLinks() {
|
||||
let endScreenLinks = document.querySelectorAll('.ytp-videowall-still');
|
||||
endScreenLinks.forEach(link => {
|
||||
// Remove any event listeners that Youtube adds
|
||||
link.addEventListener('click', (event) => {
|
||||
event.preventDefault();
|
||||
event.stopImmediatePropagation();
|
||||
|
||||
// On click, redirect the top window to the correct location
|
||||
window.top.location.href = link.href;
|
||||
}, true);
|
||||
|
||||
link.addEventListener('mousedown', (event) => {
|
||||
event.preventDefault();
|
||||
event.stopImmediatePropagation();
|
||||
}, true);
|
||||
|
||||
link.addEventListener('mouseup', (event) => {
|
||||
event.preventDefault();
|
||||
event.stopImmediatePropagation();
|
||||
}, true);
|
||||
|
||||
link.addEventListener('touchstart', (event) => {
|
||||
event.preventDefault();
|
||||
event.stopImmediatePropagation();
|
||||
}, true);
|
||||
|
||||
link.addEventListener('touchend', (event) => {
|
||||
event.preventDefault();
|
||||
event.stopImmediatePropagation();
|
||||
}, true);
|
||||
});
|
||||
}
|
||||
|
||||
// Style the iframe
|
||||
function goodTube_iframe_style() {
|
||||
let style = document.createElement('style');
|
||||
@@ -1955,7 +1993,6 @@
|
||||
.ytp-cued-thumbnail-overlay,
|
||||
.ytp-paid-content-overlay,
|
||||
.ytp-impression-link,
|
||||
.ytp-endscreen-content,
|
||||
.ytp-ad-progress-list,
|
||||
.ytp-endscreen-next,
|
||||
.ytp-endscreen-previous,
|
||||
@@ -1964,6 +2001,10 @@
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.html5-endscreen {
|
||||
top: 0 !important;
|
||||
}
|
||||
|
||||
/* Make next and prev buttons not disabled */
|
||||
.ytp-prev-button,
|
||||
.ytp-next-button {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @name GoodTube
|
||||
// @namespace http://tampermonkey.net/
|
||||
// @version 2.012
|
||||
// @version 2.013
|
||||
// @description Removes 100% of Youtube ads.
|
||||
// @author GoodTube
|
||||
// @updateURL https://github.com/goodtube4u/goodtube/raw/refs/heads/main/goodtube.user.js
|
||||
@@ -1938,10 +1938,48 @@
|
||||
// Fix fullscreen button issues
|
||||
goodTube_iframe_fixFullScreenButton();
|
||||
|
||||
// Fix end screen links
|
||||
goodTube_iframe_fixEndScreenLinks();
|
||||
|
||||
// Run actions again in 100ms to loop this function
|
||||
setTimeout(goodTube_iframe_actions, 100);
|
||||
}
|
||||
|
||||
// Fix end screen links (so they open in the same window)
|
||||
function goodTube_iframe_fixEndScreenLinks() {
|
||||
let endScreenLinks = document.querySelectorAll('.ytp-videowall-still');
|
||||
endScreenLinks.forEach(link => {
|
||||
// Remove any event listeners that Youtube adds
|
||||
link.addEventListener('click', (event) => {
|
||||
event.preventDefault();
|
||||
event.stopImmediatePropagation();
|
||||
|
||||
// On click, redirect the top window to the correct location
|
||||
window.top.location.href = link.href;
|
||||
}, true);
|
||||
|
||||
link.addEventListener('mousedown', (event) => {
|
||||
event.preventDefault();
|
||||
event.stopImmediatePropagation();
|
||||
}, true);
|
||||
|
||||
link.addEventListener('mouseup', (event) => {
|
||||
event.preventDefault();
|
||||
event.stopImmediatePropagation();
|
||||
}, true);
|
||||
|
||||
link.addEventListener('touchstart', (event) => {
|
||||
event.preventDefault();
|
||||
event.stopImmediatePropagation();
|
||||
}, true);
|
||||
|
||||
link.addEventListener('touchend', (event) => {
|
||||
event.preventDefault();
|
||||
event.stopImmediatePropagation();
|
||||
}, true);
|
||||
});
|
||||
}
|
||||
|
||||
// Style the iframe
|
||||
function goodTube_iframe_style() {
|
||||
let style = document.createElement('style');
|
||||
@@ -1955,7 +1993,6 @@
|
||||
.ytp-cued-thumbnail-overlay,
|
||||
.ytp-paid-content-overlay,
|
||||
.ytp-impression-link,
|
||||
.ytp-endscreen-content,
|
||||
.ytp-ad-progress-list,
|
||||
.ytp-endscreen-next,
|
||||
.ytp-endscreen-previous,
|
||||
@@ -1964,6 +2001,10 @@
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.html5-endscreen {
|
||||
top: 0 !important;
|
||||
}
|
||||
|
||||
/* Make next and prev buttons not disabled */
|
||||
.ytp-prev-button,
|
||||
.ytp-next-button {
|
||||
|
||||
Reference in New Issue
Block a user