mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Remove code that didn't do anything when embedding YouTube videos
This commit is contained in:
@@ -172,60 +172,8 @@ function addYouTubeVideos() {
|
||||
youTubeFrame.setAttribute("style", "position: absolute; top: 0; left: 0; width: 100%; height: 100%;");
|
||||
youTubeFrame.setAttribute("title", "YouTube video player");
|
||||
youTubeFrame.setAttribute("frameborder", "0");
|
||||
youTubeFrame.setAttribute("allow", "encrypted-media; picture-in-picture; web-share");
|
||||
youTubeFrame.setAttribute("allowfullscreen", "true");
|
||||
bodyContainer.appendChild(youTubeFrame);
|
||||
|
||||
// No YouTube ADS - YouTube https://github.com/GSRHackZ/No-ADS-YouTube
|
||||
let ogVolume=1;
|
||||
let pbRate = 1;
|
||||
|
||||
setInterval(function(){
|
||||
if(document.getElementsByClassName("video-stream html5-main-video")[0]!==undefined){
|
||||
let ad = document.getElementsByClassName("video-ads ytp-ad-module")[0];
|
||||
let vid = document.getElementsByClassName("video-stream html5-main-video")[0];
|
||||
if(ad==undefined){
|
||||
pbRate = vid.playbackRate;
|
||||
}
|
||||
let closeAble = document.getElementsByClassName("ytp-ad-overlay-close-button");
|
||||
for(let i=0;i<closeAble.length;i++){
|
||||
closeAble[i].click();
|
||||
//console.log("ad banner closed!")
|
||||
}
|
||||
if(document.getElementsByClassName("style-scope ytd-watch-next-secondary-results-renderer sparkles-light-cta GoogleActiveViewElement")[0]!==undefined){
|
||||
let sideAd=document.getElementsByClassName("style-scope ytd-watch-next-secondary-results-renderer sparkles-light-cta GoogleActiveViewElement")[0];
|
||||
sideAd.style.display="none";
|
||||
//console.log("side ad removed!")
|
||||
}
|
||||
if(document.getElementsByClassName("style-scope ytd-item-section-renderer sparkles-light-cta")[0]!==undefined){
|
||||
let sideAd_ = document.getElementsByClassName("style-scope ytd-item-section-renderer sparkles-light-cta")[0];
|
||||
sideAd_.style.display="none";
|
||||
//console.log("side ad removed!")
|
||||
}
|
||||
if(document.getElementsByClassName("ytp-ad-text ytp-ad-skip-button-text")[0]!==undefined){
|
||||
let skipBtn=document.getElementsByClassName("ytp-ad-text ytp-ad-skip-button-text")[0];
|
||||
skipBtn.click();
|
||||
//console.log("skippable ad skipped!")
|
||||
}
|
||||
if(document.getElementsByClassName("ytp-ad-message-container")[0]!==undefined){
|
||||
let incomingAd=document.getElementsByClassName("ytp-ad-message-container")[0];
|
||||
incomingAd.style.display="none";
|
||||
//console.log("removed incoming ad alert!")
|
||||
}
|
||||
if(document.getElementsByClassName("style-scope ytd-companion-slot-renderer")[0]!==undefined){
|
||||
document.getElementsByClassName("style-scope ytd-companion-slot-renderer")[0].remove();
|
||||
//console.log("side ad removed!")
|
||||
}
|
||||
if(ad!==undefined){
|
||||
if(ad.children.length>0){
|
||||
if(document.getElementsByClassName("ytp-ad-text ytp-ad-preview-text")[0]!==undefined){
|
||||
vid.playbackRate=16;
|
||||
//console.log("Incrementally skipped unskippable ad!")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},100)
|
||||
}
|
||||
|
||||
function processPage() {
|
||||
|
||||
Reference in New Issue
Block a user