`searchForm` or `search_form` is a special field that we've had on our search engine interfaces for a while. According to the [interface documentation](https://searchfox.org/mozilla-central/rev/23bf1890e07f780ba70e075bc8f46ffb85d1128c/toolkit/components/search/nsISearchService.idl#146), `searchForm` is: ``` A URL string pointing to the engine's search form. ``` It is not in the [OpenSearch documentation](https://github.com/dewitt/opensearch/blob/master/opensearch-1-1-draft-6.md) nor in the [WebExtension documentation](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/chrome_settings_overrides#syntax). It looks like we are inconsistently defining it: https://searchfox.org/mozilla-central/search?q=search_form&path=&case=false®exp=false Some places we're using just the base page of the site, some places we're using the full search url with replacements (that would never be replaced). It is used in a [couple of places in address bar code](https://searchfox.org/mozilla-central/search?q=searchForm&path=urlbar&case=false®exp=false), and a [couple of places in newtab code](https://searchfox.org/mozilla-central/search?q=searchForm&path=urlbar&case=false®exp=false). At a quick glance, it looks like we are only matching against the start of the URL in a lot of these cases - so we might be able to compare with an empty submission url instead (a submission url with an empty string for a query). However, one of the [newtab cases](https://searchfox.org/mozilla-central/rev/23bf1890e07f780ba70e075bc8f46ffb85d1128c/browser/components/newtab/lib/TopSitesFeed.jsm#898) seems potentially more complex (as the search form and submission url differ), so we should check we wouldn't break that case if we make changes. Overall, I think we should either drop support for `searchForm` or replace it with using an empty submission url.
Bug 1781766 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
`searchForm` or `search_form` is a special field that we've had on our search engine interfaces for a while. According to the [interface documentation](https://searchfox.org/mozilla-central/rev/23bf1890e07f780ba70e075bc8f46ffb85d1128c/toolkit/components/search/nsISearchService.idl#146), `searchForm` is: ``` A URL string pointing to the engine's search form. ``` It is not in the [OpenSearch documentation](https://github.com/dewitt/opensearch/blob/master/opensearch-1-1-draft-6.md) nor in the [WebExtension documentation](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/chrome_settings_overrides#syntax). It looks like we are inconsistently defining it: https://searchfox.org/mozilla-central/search?q=search_form&path=&case=false®exp=false Some places we're using just the base page of the site, some places we're using the full search url with replacements (that would never be replaced). It is used in a [couple of places in address bar code](https://searchfox.org/mozilla-central/search?q=searchForm&path=urlbar&case=false®exp=false), and a [couple of places in newtab code](https://searchfox.org/mozilla-central/search?q=searchForm&path=newtab&case=false®exp=false). At a quick glance, it looks like we are only matching against the start of the URL in a lot of these cases - so we might be able to compare with an empty submission url instead (a submission url with an empty string for a query). However, one of the [newtab cases](https://searchfox.org/mozilla-central/rev/23bf1890e07f780ba70e075bc8f46ffb85d1128c/browser/components/newtab/lib/TopSitesFeed.jsm#898) seems potentially more complex (as the search form and submission url differ), so we should check we wouldn't break that case if we make changes. Overall, I think we should either drop support for `searchForm` or replace it with using an empty submission url.