-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with opening share url in a new tab #3
Comments
I thought about your idea but unfortunately, there's no way to assign $.Radiko.area.id just between they assigned "OUT" and |
Yep, can't change the assignment because of always. So you need to override the whole function. I managed to do it in my userscript, using it as a hotfix for the browser loop issue. I override the I've tried various way to observe
Perhaps you know a better way to override that |
Thanks for your code. Basically , i don't want modify radiko's code , since it may change. And have a test on https://github.com/jackyzy823/rajiko/archive/refs/tags/v0.2.8.zip (not upload to chrome web store) . it may fix this issue. |
On Edge, most of the time it goes like : share url -> timeshift url -> out url -> timeshift url, pink interface but with home content. I think it depends on how slow/quick things being processed. When I open browser's DevTools, all the console logs & debugging slowing down the browser, it had enough time to process everything and it end with the correct timeshift page. Immediately when I close DevTools, and retry any share url, most of the time it will end at timeshift url, pink interface but with home content. These makes me realized that my Brave is connected to JP VPN, so this add more latency while loading all the ajax request and processing stuff. Immediately when I use my normal connection, Brave showing the same behaviour as Edge (inconsistent). In other words, once the page reached "out url", the page render might have finished at the same time when Perhaps try to add some delay? setTimeout? Let the "out url" settled down a bit before triggering the url change. |
Can confirm it's inconsistent and depends on how slow it is. And it's not limited to share link, directly open All my tests are done with my native non-Japan IP. |
I really really have no idea about this. in my understand, window.addEventListener('hashchange', function(event) { runs before DOM is loaded. So it will 100% be triggered and triggered before whatever the network speed. It is so weird. |
I think it less about network speed, but more about how quick (or slow) the browser finished processing radiko's code. In general, your fix works. It's just the url change happened too fast so the radiko's code that handling the page render is somehow ignoring the hash change. Or perhaps radiko's code didn't catch the hash change at all, so it rendered a wrong page. As I proposed before, try add setTimeout :
I tried it just now. Probably not a pretty solution, but it works. Even 500ms seems enough. And that seems to confirm the wrong page was caused by the url changed too quick. |
Thanks for your test. I might found the key to the problem.
and step 2 and ( 3 + 4 ) order is not guaranteed. So the only way is to add some delay. 😞 |
Finally . I decide to hijack jquery.ajax to make Dirty work. Dirty code. but make sense. |
Link example http://radiko.jp/share/?t=20210329153524&sid=JORF
On Edge 89.0.774.63, (sometimes?) it will stuck in a loop (share -> radio page -> radiko out -> share -> radio page -> radiko out ...)
On Brave 1.22.70, it will navigate back to the empty new tab
I guess it's related to the recent change and somehow each browsers dealt with it differently.
Idea : Instead of relying on location hash, is it possible to deal with this directly?
area.js
The extension blocking ajax call to /area which make them to assign the default value of $.Radiko.area.id to "OUT". This seems to be the ultimate final check that causing user to be redirected to #!/out .
Override $.Radiko.area.id to any value (or to the relevant value from cookie) after they assign "OUT", and user will get a proper web page.
The text was updated successfully, but these errors were encountered: