Diskusie » Žiadosť o vytvorenie
Youtube - land on user's video page by default
That can be done in two ways:
- Rewrite the user page links on any site to point to videos page, use Ctrl-Alt-click to skip redirection:
// ==UserScript==
// @name Youtube: open user's videos instead of the personal page
// ==/UserScript==
window.addEventListener('click', function(e) {
if (e.altKey)
return;
var a = e.target;
//search the parent A element if needed, max 10 levels up the hierarchy
for (i=10; a.localName != 'a'; i--, a = a.parentNode)
if (i==0 || !a.parentNode)
return;
a.href = a.href.replace(/(youtube\.com.*?\/user\/[^\/]+)(?:\/featured)?\/?$/, '$1/videos');
});
- Redirect to the videos page only when a user page is opened, which will be briefly visible:
// ==UserScript==
// @name Youtube: open user's videos instead of the personal page
// @include https://www.youtube.com/user/*
// ==/UserScript==
if (m = location.href.match(/(^.+?youtube\.com.*?\/user\/[^\/]+)(?:\/featured)?\/?$/))
location.href = m[1] + '/videos';
Sounds good, but doesn't seem to work. The first script does nothing at all, and the second one does redirect to the videos page, but it reloads the video page over and over in and endless loop. Did you try the scripts?
Fixed a few typos, try it again.
Youtube - land on user's video page by default
Simple request (I hope)
Any time you land on a youtube user's home page, for example https://www.youtube.com/user/grindinggear/featured
Redirect automatically to the video's page: https://www.youtube.com/user/grindinggear/videos