Fix URL copied via right click menu
Pull Request Type
- [x] Bugfix
- [ ] Feature Implementation
- [ ] Documentation
- [ ] Other
Related issue
#4687
Includes code from #4687 so you can test that PR properly but not saying that PR can be merged already
Description
Fix URL copied via right click menu
Fixes:
- Invalid URL when copying IV video
- URL with user playlist ID
- Playlist URL can be copied via right clicking on a user playlist link
Screenshots
Testing
- Right click copy on a video with user playlist (Local & IV URL), ensure URL correct (no double question mark, nor playlist ID)
- Right click copy on a video withremote playlist (Local & IV URL), ensure URL correct (no double question mark, with playlist ID)
- Right click copy on a link with user playlist, ensure no entry for copying URL
- Right click copy on a link withremote playlist (Local & IV URL), ensure URL correct
- Test cases in #4687
Desktop
- OS:
- OS Version:
- FreeTube version:
Additional context
Could you please also hide the Copy Link options when right clicking on a user playlist on the user playlist page (see screenshot)?
Something like this should work:
if (path) {
- visible = ['/playlist', '/channel', '/watch'].some(p => path.startsWith(p))
+ visible = ['/channel', '/watch'].some(p => path.startsWith(p)) ||
+ (path.startsWith('/playlist') && !/[&?]playlistType=user(?:&|$)/.test(path))
}
Updated, added Playlist URL can be copied via right clicking on a user playlist link to desc about fixed items, added test cases
Does this PR needs updating now that #4687 has been merged?
Why I can't rebase via UI here :( Me lazy
Rebased, 2 commits left