youtube dark mode stop riproduzione autom
当前为
// ==UserScript==
// @name Youtube Dark figuccio
// @namespace https://greasyfork.org/users/237458
// @version 1.3
// @description youtube dark mode stop riproduzione autom
// @author figuccio
// @match https://*.youtube.com/*
// @run-at document-start
// @grant GM_addStyle
// @grant GM_setValue
// @grant GM_getValue
// @noframes
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
// ==/UserScript==
//f5=20000 autoplay on f5=30000 autoplay off
document.cookie = "PREF=f1=50000000&f5=30000&f6=400; domain=.youtube.com;max-age=315360000";
//Rimuovi Youtube Commenti
GM_addStyle('ytd-comments.style-scope{ display:none !important; }');
//adblock grosso banner youtube premium
GM_addStyle(`#masthead-ad { display: none !important; }`);
//promemoria privacy
document.cookie = "HideTicker=true;domain=.youtube.com;max-age=315360000";
//annotazioni video
GM_addStyle(`.html5-video-player .ytp-cards-button{ display: none !important; }`);
//////////////////// hide "guide" menu
$(document).ready(function() {
(function() {
var guide_button=document.getElementById('guide-button');
if(guide_button){
var tmp=guide_button.getElementsByTagName('button');
if(tmp.length) {
tmp=tmp[0].attributes;
if(tmp&&tmp['aria-pressed'].value=='true')
guide_button.click();
}
}
})();
});
///////////////////////////////////////////////////comandi video colorati
GM_addStyle('.ytp-exp-bottom-control-flexbox .ytp-left-controls,.ytp-play-button:not(.ytp-play-button-playlist)::before,.ytp-fullscreen-button::after,.ytp-button:not([aria-disabled=true]):not([disabled]):not([aria-hidden=true]){background-color:green!important;}');
//youtube stai zitto
(function(){
"use strict";
function consent() {
var e=document.querySelector('#introAgreeButton');
e && e.click();
}
if (location.href.startsWith('https://consent.youtube.com/')) {
if (document.readyState != 'loading') consent();
else document.addEventListener('DOMContentLoaded', consent);
return;
}
if (document.cookie.includes('APISID=')) return;
var obs=new MutationObserver(function(mutL){
for (let mut of mutL) {
var t=mut.target;
if (t.id=='dismiss-button' && t.classList.contains('yt-upsell-dialog-renderer')) {
setTimeout(function(){t.click()}, 300);
return;
}
}
});
var c=10;
function setObs(){
var r=document.querySelector('ytd-app ytd-popup-container');
if (!r) {
--c && setTimeout(setObs, 100);
return;
}
obs.observe(r, {childList: true, subtree: true});
}
if (document.readyState != 'loading') setObs();
else document.addEventListener('DOMContentLoaded', setObs);
var s=document.createElement('style');
s.textContent="#consent-bump,iron-overlay-backdrop,yt-upsell-dialog-renderer{opacity:0;}yt-upsell-dialog-renderer *{display:none !important;}ytd-app > ytd-consent-bump-lightbox,ytd-app ~ iron-overlay-backdrop{display:none;}"
document.head.append(s);
s=document.createElement('script');
s.textContent= `(function(){var c=80, pl, oldp={};
function f(){
pl=document.querySelector('#movie_player');
if (!pl) {
--c && setTimeout(f,200);
return;
}
else {
for (let i in pl) if (typeof pl[i] == 'function') {
if ( !['cancelPlayback', 'pauseVideo', 'stopVideo'].includes(i) ) continue;
oldp[i]=pl[i];
pl[i]=function() {
let st=(new Error()).stack;
if ( (st.search(/(f\\.onFulfilled|scheduler\\.js:)/)>0) ) return;
oldp[i].apply(this,arguments);
}
}
}
}
if (document.readyState != 'loading') f();
else document.addEventListener('DOMContentLoaded', f);
})();
`;
document.documentElement.append(s);
if (s.parentNode) s.parentNode.removeChild(s);
})();