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

Add rewrite rule to open HN comments w/ iOS apps #2078

Merged
merged 4 commits into from
Sep 23, 2023

Conversation

aldur
Copy link
Contributor

@aldur aldur commented Sep 16, 2023

Here's my use case: I use hnrss.org as a feed for news.ycombinator.com, which returns entries as follows:

Screenshot 2023-09-16 at 15 57 33

When browsing from iPhone/iPad, clicking the "Comments URL" link opens Safari, instead of HN-specific apps (HACK, for example, or Opener for a more generic solution).

This PR adds two rewrite rules that add a "deep-link" to open the content directly in the app, as follows (the screenshot shows both rewrites applied):

Screenshot 2023-09-16 at 16 00 14

NOTEs:

  • In order to make this work, I had to add two additional schemes to the sanitizer's whitelist. Not sure whether this is acceptable. A workaround that doesn't require modifying the whitelist is to to do this: keep a HTTPS scheme and point the link to a web-server which will then redirect the user to the hack:// or opener:// scheme.
  • Not sure about the policy for adding rewrite rules; this is useful to me, would be useful to the community as well?

Do you follow the guidelines?

@fguillot
Copy link
Member

I'm okay to merge your pull-request, however it would be nice to have a unit test for the new rewrite rule.

@aldur
Copy link
Contributor Author

aldur commented Sep 23, 2023

I'm okay to merge your pull-request, however it would be nice to have a unit test for the new rewrite rule.

Makes sense and should have added them earlier. Done :)

@fguillot fguillot merged commit 54cb8fa into miniflux:main Sep 23, 2023
15 checks passed
@aldur aldur deleted the add_hn_links_using branch September 24, 2023 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants