你正在訪問的內容是外部程式的映像位址,僅用於使用者加速訪問,本站無法保證其可靠性。當前的連結位址(單點即可複製)為 https://greasyfork.org.cn/zh-CN/scripts/1193-youtube-link-cleaner/discussions/11154,源站連結 點此以跳轉。
Removes unneeded parameters and redirection pages from YouTube links.
@tfr , Can you update your new version so it doesn't reload the page ?
TIA.
That actually works really well.
Except history.replaceState(null,null,url); replaces the page URL, while history.pushState(null,null,url); keeps the old url in the navigation history, so pressing back will go to the unwanted url.
Contribution
I've made a little updated version where I added my url parser to grab the relevant parameters and recreate the links rather than cutting irrelevant ones off.
It also uses
history.pushStaterather thanlocation.replaceto change the url bar so it won't reload the page.Source: https://gist.github.com/Zod-/88a0c303caef51eb2597