Repository navigation
feat: OpenSearch, so browsers can add the forum as a search engine - #5321
Merged
Merged
Conversation
imorland
marked this pull request as ready for review
October 28, 2026 22:02
This was referenced Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: no issue filed.
Changes proposed in this pull request:
Browsers can't add a Flarum forum as a search engine, so searching it from the address bar means opening the forum first. This adds OpenSearch support.
/opensearch, linked from every page with<link rel="search">. It names the forum, gives the search address (/?q={searchTerms}), a suggestions address and its own address for updates, and embeds the favicon as a 16px.icoand a PNG of at most 64px. Embedded, the icon stays under Firefox's 10KB limit for linked icons and doesn't depend on where assets are served. Served by Flarum without an.xmlextension, which Flarum's suggested nginx config would only look for on disk./api/opensearch/suggestions, in the OpenSearch suggestions format: titles of discussions the visitor can see, with their addresses. Titles are matched on the start of their words, so a word is completed as it's typed. The forum's search matches whole words on MySQL, MariaDB and PostgreSQL, so it can't suggest anything until a word is finished.short_name.Reviewers should focus on:
Necessity
Confirmed
yarn testinjs/).composer test).whereLike()usingILIKE.)