YouTubeRedux icon indicating copy to clipboard operation
YouTubeRedux copied to clipboard

[bug] page back on shorts with "hide shorts" enabled

Open Thespikedballofdoom opened this issue 3 years ago • 4 comments

I'm assuming it naturally comes from a redirect, but it is irritating. Maybe replacing the links themselves on youtube as well as modifying links that are directly entered in, so it still works on outside links.

Thespikedballofdoom avatar Apr 22 '22 16:04 Thespikedballofdoom

I don't get it. What exactly is the issue here?

omnidevZero avatar Apr 22 '22 22:04 omnidevZero

If you go to the previous page on firefox after clicking a shorts video it hitches and then goes back to the video. Apologies for late response

Thespikedballofdoom avatar Apr 24 '22 21:04 Thespikedballofdoom

I think that's an issue with YouTube itself as I was able to reproduce it with Redux disabled by watching one short, scrolling to another short and then pressing back in the browser. Doesn't always happen though.

omnidevZero avatar Apr 25 '22 10:04 omnidevZero

When you click on a short, and get redirected from' /shorts/' to '/watch?v=' the original url gets saved in your history, so pressing the back button leads you back to /shorts/, which gets once again redirected to '/watch?v=', I had the same issue on the first version of my redirect script, using 'location.replace' instead of 'location.href' gave the desired result, so changing the function at https://github.com/omnidevZero/YouTubeRedux/blob/master/Firefox/main.js#L951 from

function redirectShorts() {
	const currentLocation = window.location.href;
	const redirectLocation = currentLocation.replace('/shorts/', '/watch?v=');
	window.location.href = redirectLocation;
}

to

function redirectShorts() {
	const currentLocation = window.location.href;
	const redirectLocation = currentLocation.replace('/shorts/', '/watch?v=');
	window.location.replace(redirectLocation);
}

should fix this. (Correct me if I misinterpreted your issue)

Franck-Nein avatar May 04 '22 18:05 Franck-Nein