Skip to content
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

Show available actions on embed error page #4760

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

johansenja
Copy link

Context

If you have privacyRedirect installed in your browser, any embedded youtube videos are automatically replaced by an invidious equivalent on pages you visit. The trouble is, often embeds don't always work - if 1/ the selected instance is down; 2/ the video is blocked or similar.

Current flow

If you particularly want to watch the video, you might right-click the iframe, click open in new tab, then replace the /embed/ part of the url with /watch?v= - or replace the domain with youtube.com to see the youtube version of it (but still as an embed)

Desired flow

It would be great if you had the same actions available on regular video error pages (switch instance / watch on youtube / refresh)

Caveats

It's worth noting that different browsers handle links inside iframes differently; eg. firefox often prompts you to open the link in a new tab - which IMO is ok, because if you are interested enough in the video to want to watch it, you would probably prefer to at least have this automatically, rather than doing it manually?

Chrome, on the other hand, doesn't even give you the option to "open frame in new tab" when you right click it, but it does seem to follow urls within the frame

Summary of changes in PR

  • Add request_path.starts_with?("/embed") check to error_redirect_helper

  • Move HTML string from error_redirect_helper into separate template
  • Add unit tests for error_redirect_helper
  • Add ContextWithPreferences and test_env helpers to help with test setup/compilation

The first point is obviously the main functional change, and the latter 3 are IMO code quality improvements (so they can be modified/removed if they are not helpful here)

Testing

I don't have this set up fully e2e locally so haven't checked this fully, but I found the unit tests went a decent way to verifying the behaviour I wanted

@johansenja johansenja requested a review from a team as a code owner June 21, 2024 17:46
@johansenja johansenja requested review from syeopite and removed request for a team June 21, 2024 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant