Open Harry-Dang opened 1 year ago
function redirectToWatchPage() {
const { origin, pathname } = location;
const isShorts = pathname.startsWith("/shorts/");
const newURL = `${origin}${pathname.replace("shorts", "watch")}`;
isShorts && location.replace(newURL);
}
function run() {
redirectToWatchPage();
document.addEventListener("yt-navigate-start", redirectToWatchPage);
}
yesss personally I use this userscript
document.addEventListener('DOMSubtreeModified', function (e){
.....
} else if (event.target.tagName && (event.target.tagName == 'YT-HORIZONTAL-LIST-RENDERER' || event.target.tagName == 'YTD-SECTION-LIST-RENDERER'
|| event.target.tagName == 'YTD-ITEM-SECTION-RENDERER' || event.target.tagName == 'YTD-THUMBNAIL')
&& event.target.querySelector('.ytd-thumbnail a[href^="/shorts/"], .ytd-reel-item-renderer a[href^="/shorts/"], .ytd-compact-video-renderer a[href^="/shorts/"], ytd-grid-video-renderer a[href^="/shorts/"]')) {
Array.from( event.target.querySelectorAll('a[href^="/shorts/"]')).forEach(el => {
el.href=el.href.replace('/shorts/','/watch?v=')
})
}
to overwrite shorts links instead of redirecting after the fact
I use https://github.com/einaregilsson/Redirector for that - but in general i'd say there probably are enough users that would only need it for YT-shorts to warrant implementing it here :+1:
Hey is this issue still open? Can i work on it??
I'm going to start working on this issue now.
I was wondering if anyone has any opinions on whether it should be redirecting from Shorts or overwriting Shorts links? The latter would probably have a smoother experience, but it won't work if you click on a Shorts link from outside of Youtube such as Discord
My plan is to implement both as separate switches so the user can decide which they prefer
- https://github.com/doma-itachi/Youtube-shorts-block MIT license & 50 000+ users👍
@doma-itachi join us?😳☀️#1383 #1146 (#1168 #1389 #1391)
hiding shorts everywhere: https://github.com/ProbablyRaging/hide-youtube-shorts
(store version requires browser history access...?)hiding shorts on the homepage: https://chrome.google.com/webstore/detail/no-youtube-shorts/hjfkenebldkfgibelglepinlabpjfbll
https://github.com/code-charity/youtube/issues/1233#issuecomment-1140619890
All issues pretaining to this matter are now closed. What's going on ? Thanks
hiding shorts everywhere: https://github.com/ProbablyRaging/hide-youtube-shorts
(store version requires browser history access...?)hiding shorts on the homepage: https://chrome.google.com/webstore/detail/no-youtube-shorts/hjfkenebldkfgibelglepinlabpjfbll
Time to tag @benlad @ProbablyRaging too 👋 since we long started implementing such independently, further inflating maintenance among the sum of us volunteers. Check #1881 for some: "If we work on this at all, lets work together"
hi @ProbablyRaging! :) oh no, i didnt see it is archived already (Imagine how many times i have experienced this over the years)
I disagree with link modification ... externally shared links .. global ... memory .. A LOT
hi! @codefaux edit / just consolidating the threads(@raszpl )
Observe navigation: navigation.addEventListener('navigate', () => { ... });
Observe changes to document.location.href ( #2276 )
Run forwarding through Browser API (in a "background.js" / "worker.js"): declarativeNetRequest like adblockers ( while onBeforeRequest is restricted & manifest3 is enforced )
Run an content script only for youtube.com/shorts
chrome.storage.local.get('no_shorts_player', function (result) { if (result.no_shorts_player === true) {
...redirect... (no need to window.stop;)
}});
& in manifest.json:
"content_scripts": [
{ "......" }
{ "js": [ "js&css/extension/www.youtube.com/redirectshorts.js"],
"matches": [ "https://www.youtube.com/shorts"],
"run_at": "document_start"
}
⚬ PROBLEM: The Shorts player (
/shorts/id
) has poor UX, especially when compared to the default player (/watch?v=id
). You cannot adjust the volume, scrub through the video, etc. People dislike the Shorts player because it is different from the default player⚬ SOLUTION:
Add an option to automatically redirect from the Shorts player to the default player
⚬ ALTERNATIVES: Add a volume slider and the ability to scrub through the Short on the Shorts player
⚬ RELEVANCE / SCOPE: People generally dislike Shorts. If the player uses the default player, more people may want to watch Shorts more often
⚬ "SIDE EFFECTS":
People who generally dislike Shorts as a whole or do not mind the Shorts player may be annoyed by this feature
⚬ CONTEXT: If this is a feature that people are interested in, I would be interested in implementing it