Greasy Fork is available in English.
Gives you a seekbar, autoplay option, volume options, etc.
< BYTS(Better YouTube Shorts) - Greasyfork Edition 피드백
// @match *://*.youtube.com// @match *://*.youtube.com/*// @match *://*.youtu.be// @match *://*.youtu.be/*var oldHrefz = document.location.href;window.onload = function() { var bodyList = document.querySelector("body") var observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { if (oldHrefz != document.location.href) { oldHrefz = document.location.href; if(oldHrefz.indexOf('/shorts/') != -1 && !loaded){ var checkExist = setInterval(() => { if ($('ytd-shorts').length && $('.html5-video-player').length) { clearInterval(checkExist); LoadSettings(); loaded = true; setInterval(updateVidElem, 50); addEventListener("keydown", function (e) { switch (e.key.toUpperCase()) { case "ARROWLEFT": $(vid).prop('currentTime', $(vid).prop('currentTime') - 2) break; case "ARROWRIGHT": $(vid).prop('currentTime', $(vid).prop('currentTime') + 2) break; default: break; } }); } }, 100); console.log('loading ytd short') } else if(oldHrefz.indexOf('/shorts/') != -1 && loaded) { console.log('not loading ytd short') } else { clearInterval(updateVidElem); } } }); }); var config = { childList: true, subtree: true }; observer.observe(bodyList, config);};
// @match *://*.youtube.com// @match *://*.youtube.com/*// @match *://*.youtu.be// @match *://*.youtu.be/*
var oldHrefz = document.location.href;window.onload = function() { var bodyList = document.querySelector("body") var observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { if (oldHrefz != document.location.href) { oldHrefz = document.location.href; if(oldHrefz.indexOf('/shorts/') != -1 && !loaded){ var checkExist = setInterval(() => { if ($('ytd-shorts').length && $('.html5-video-player').length) { clearInterval(checkExist); LoadSettings(); loaded = true; setInterval(updateVidElem, 50); addEventListener("keydown", function (e) { switch (e.key.toUpperCase()) { case "ARROWLEFT": $(vid).prop('currentTime', $(vid).prop('currentTime') - 2) break; case "ARROWRIGHT": $(vid).prop('currentTime', $(vid).prop('currentTime') + 2) break; default: break; } }); } }, 100); console.log('loading ytd short') } else if(oldHrefz.indexOf('/shorts/') != -1 && loaded) { console.log('not loading ytd short') } else { clearInterval(updateVidElem); } } }); }); var config = { childList: true, subtree: true }; observer.observe(bodyList, config);};
How to use this code. and can i apply for tiktok?Thanks!
댓글을 남기려면 로그인하세요.
// @match *://*.youtube.com
// @match *://*.youtube.com/*
// @match *://*.youtu.be
// @match *://*.youtu.be/*
var oldHrefz = document.location.href;
window.onload = function() {
var bodyList = document.querySelector("body")
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if (oldHrefz != document.location.href) {
oldHrefz = document.location.href;
if(oldHrefz.indexOf('/shorts/') != -1 && !loaded){
var checkExist = setInterval(() => {
if ($('ytd-shorts').length && $('.html5-video-player').length) {
clearInterval(checkExist);
LoadSettings();
loaded = true;
setInterval(updateVidElem, 50);
addEventListener("keydown", function (e) {
switch (e.key.toUpperCase()) {
case "ARROWLEFT":
$(vid).prop('currentTime', $(vid).prop('currentTime') - 2)
break;
case "ARROWRIGHT":
$(vid).prop('currentTime', $(vid).prop('currentTime') + 2)
break;
default:
break;
}
});
}
}, 100);
console.log('loading ytd short')
} else if(oldHrefz.indexOf('/shorts/') != -1 && loaded) {
console.log('not loading ytd short')
} else {
clearInterval(updateVidElem);
}
}
});
});
var config = {
childList: true,
subtree: true
};
observer.observe(bodyList, config);
};