hypothesis / hypothesis/product-backlog
Redirect from Via to original URL if original URL embeds client
- Dominant language
- No language data
- Stars
- 122
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
## Feature Request Form
### Problem you are trying to address with this feature
Proxying a page through Via has many disadvantages compared to visiting the original page directly, if the original page already embeds the client. Some of these are inherent to using a proxy service, others are due to the current implementation. These include:
- A slower loading page due to proxying the page plus resources through the proxy
- The user not being able to access features that are behind a login.
- Load on the proxy service itself
- The proxy's URL rewriting can break various features of web applications
- It is unpredictable whether or not the client will reflect any custom configuration that the page sets for the client
- Pages that use the client/service's third party accounts feature (eg. eLife) are highly likely to be broken when visited through Via.
### Your solution
Via should apply some simple heuristics to check whether the page that it is proxying already embeds the client. If so it should redirect to that the original URL instead of proxying the page. If possible, the redirection should preserve any fragment identifier so that direct linking works properly.
These checks could be done either in the Python application or in the HTML/JS "banner" that Via prepends to the original HTML content. Doing it in the Python application would be best for end-user performance.
There is a proof of concept here: https://github.com/hypothesis/via/compare/redirect-if-original-page-embeds-client
Contributor guide
No contributing guide indexed for this repository
Research direction
Review the proof of concept in the linked compare branch, then inspect Via’s Python application and its HTML/JS banner entry points. Determine how to detect an embedded client and preserve URL fragments; done means matching pages redirect to the original URL while other pages remain proxied.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html, javascript, python
- Domain
- backend, web-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100