For enterprise use, needless default search engines are expected to be disabled, and sometimes custom search engines are needed to be installed by default. Currently we need to control search engines via nsIBrowserSearchService from an addon to do it. After WebExtensions, I need something to alter the feature. Of course, non-WebExtensions solution (new secret preferences to do it, or new configuration entries in distribution.ini) will also help me.
I think the API can be appear like APIs to control tabs, like: chrome.searchengines.query() // list search engines chrome.searchengines.get() // get one engine chrome.searchengines.install() // add new search engine chrome.searchengines.create() // add new search engine from scratch without XML file - I think this will help us to generate search engines with different parameters easily (for example, different trees in dxr.mozilla.org)
I tried to port https://addons.mozilla.org/en-US/firefox/addon/add-to-search-bar/ to a WebExtension but this bug is a blocker for it.
Hello, my Search Buttons Bar extension requires API to query user's Search engines. As a WebExtension I didn't find any working solutions to achieve it. I'm currently using the nsIBrowserSearchService. https://addons.mozilla.org/addon/searchbuttonsbar/
To be discussed at Dec. 13, 2016 WE triage meeting. Agenda: https://docs.google.com/document/d/1S1QrBK1hrulE7dlLiQzjMupHUUSwDYRYAOXiqtMHe-k/edit#
I don't see this as a high priority currently, but agree search services need review, and should include the search team. Search is frequently targeted by browser hijackers, and the policy around search needs to be reviewed, updated, and surfaced in the product. Off the top I don't see querying and/or using existing search services to present challenges, but there do need to be better user controls in place for any kind of modification outside that. This may also be impacted by work on platform, search, front-end, and other components, and it makes sense to get more input. I'll add this to my backlog, and will try to get a rough proposal out before the holidays start in earnest.
As Qwant partnering closely with Mozilla, we are looking for this bug to move forward. Our current extension is not compatible with Electrolysis and this bug is missing for us to migrate our extension to WebExtensions. Any chance to prioritize this as high ?
I drafted something here: https://gist.github.com/nt1m/cad0b5afb35785d051785a51a4f6cf98
I there, I also require a WebExtensions API to access the browser's search engines (I use nsIBrowserSearchService currently), so this would make it possible to port my add-on. I'm the developer of Swift Selection Search: https://addons.mozilla.org/en-US/firefox/addon/swift-selection-search
Could it be possible to add the ability to clear the search bar text on the API ?
Shouldn't chrome.searchengines.setDefault() // set one engine as default be part of the API
(In reply to Tobias Mueller from comment #11) > Shouldn't > > chrome.searchengines.setDefault() // set one engine as default > > be part of the API There's Bug 1301315 for this.
(In reply to Tim Nguyen :ntim from comment #12) > There's Bug 1301315 for this. Afaik this bug handles setting via manifest file only. What about if an extension wants manage search engines? Or provide a setting to change the default?
(In reply to Tobias Mueller from comment #13) > Or provide a setting to change the default? Is the UI in the Firefox preferences not enough to set the default? I don't expect users to need to change their default engines frequently.
The UI in Firefox makes it very simple for the user to change defaults. At this time, we don't plan on adding the capability to set the search default via an extension with the WebExtensions API. (In reply to Tobias Mueller from comment #13) > (In reply to Tim Nguyen :ntim from comment #12) > > There's Bug 1301315 for this. > Afaik this bug handles setting via manifest file only. > What about if an extension wants manage search engines? Or provide a setting > to change the default?
Will there be an API to get all the details (icon, prefix URL and search engine name) for the current (default) search engine?
See bug 1301315 for query details. (In reply to Geoffrey De Belie (Smile4ever) from comment #16) > Will there be an API to get all the details (icon, prefix URL and search > engine name) for the current (default) search engine?
Getting the default search engine would help with an extension wishing to cleanly assign the search provider itself in it's own container, as per: https://github.com/mozilla/testpilot-containers/issues/434
I'm totally new to developing ffx extensions and I wanted to create a web extension that uses the search engines from the search bar. I encountered a lot of trouble trying stuff from the MDN only to finally discover that you can't import nsIBrowserSearchService when using the WebExtensions API. I'm surprised to see that this has been a pending issue for a year now despite being very blocking for many extension developers. Can somebody please explain what is holding back firefox developers from unblocking the situation? Is the issue technical or political? I've been a encouraging donator for the further development of firefox, but this is a bit disappointing!
(In reply to Olivier de Broqueville from comment #19) > I'm totally new to developing ffx extensions and I wanted to create a web > extension that uses the search engines from the search bar. I think you want bug 1352598. >Can somebody please explain what is holding back firefox developers from unblocking the situation? Changing the search engines (unlike just querying them, see the linked bug) is controversial because changing the default search engine is one of the most common hijacking attacks against browsers.
(In reply to Gian-Carlo Pascutto [:gcp] from comment #20) > Changing the search engines (unlike just querying them, see the linked bug) > is controversial because changing the default search engine is one of the > most common hijacking attacks against browsers. Thank you for your explanation, Gian-Carlo. Personally, I'm not looking for a way to modify the default search engine. I wanted to create a contextual search extension, which integrates with Firefox's search bar. Right-clicking on selected text in a web page would present a user with a contextual menu listing all the search engines he or she uses in the search bar. Unfortunately, with WebExtensions, I currently have no way of reading the list of search engines available in the search bar. For the mean time, I've resorted to creating a pre-specified list of search engines a user has to choose from, but I understand some users would preferably define their own search engines.