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

feat: add support for OpenSearch browser hinting. #178

Merged
merged 5 commits into from Jan 24, 2024

Conversation

andypiper
Copy link
Collaborator

This PR aims to be a clean patch that adds support for telling web browsers about a Postmarks instance as a search option, via the (now dated, but still pretty well-supported) OpenSearch XML syntax.

  • adds a small additional package dependency (xml2js)
  • the Postmarks server now serves /opensearch.xml via a new route handler
  • added <link> hint pointing to the search provider document to the main.hbs template so it is included in every page

Works in Firefox, MS Edge, Chrome, Arc; no sign of this feature in Vivaldi or Opera.

May or may not be widely useful, but it is also (sort of) another half of the "send to" story, which I've been lightly tinkering with; there may also be an option to build this kind of search engine hinting into a browser extension.

Signed-off-by: Andy Piper <andypiper@users.noreply.github.com>
@andypiper andypiper added the enhancement New feature or request label Jan 21, 2024
Signed-off-by: Andy Piper <andypiper@users.noreply.github.com>
Copy link
Owner

@ckolderup ckolderup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is so cool! I guess I always knew there was a standard to make this work in Firefox, but I've never actually looked up what it was.

Tested on my test Glitch app and it works with Firefox as expected. Thanks!

@andypiper andypiper merged commit b09b248 into ckolderup:main Jan 24, 2024
1 check passed
@andypiper andypiper deleted the opensearch branch January 24, 2024 21:31
@andypiper andypiper self-assigned this Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants