# How to change Search Engine from Add-On?

**URL:** <https://discourse.mozilla.org/t/how-to-change-search-engine-from-add-on/32968>\
**Category:** Development\
**Created:** [October 31, 2018, 5:43am UTC](https://discourse.mozilla.org/t/how-to-change-search-engine-from-add-on/32968 "2018-10-31T05:43:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![arunpuri](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@arunpuri](https://discourse.mozilla.org/u/arunpuri)\
**Post date:** [October 31, 2018, 5:43am UTC](https://discourse.mozilla.org/t/how-to-change-search-engine-from-add-on/32968/1 "2018-10-31T05:43:39Z")

</div>

Our team is developing an add-on, which among other things, would add a search engine to user’s search engine list. We are using “chrome\_settings\_overrides” for this purpose and works well.  
To my understanding, this way the engine would be set once and at install time of Add-On. We want to have a way to trigger the same from Add-On’s popup, not at install time, i.e. Change search engine when user explicitly clicks/adds/agrees from Add-On’s UI. Is this possible to do the change this way instead of one time during installation?

---

<div class="post-metadata">

**Author:** ![jscher2000](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/jscher2000/32/28202_2.png) [@jscher2000](https://discourse.mozilla.org/u/jscher2000)\
**Post date:** [November 17, 2018, 12:45am UTC](https://discourse.mozilla.org/t/how-to-change-search-engine-from-add-on/32968/3 "2018-11-17T00:45:03Z")

</div>

Can you use the method that a website would use:

```auto
window.external.AddSearchProvider(engineURL);

```

> **[OpenSearch description format | MDN](https://developer.mozilla.org/en-US/docs/Web/OpenSearch)**
>
> The OpenSearch description format can be used to describe the web interface of a search engine. This allows a website to describe a search engine for itself, so that a browser or other client application can use that search engine. OpenSearch is...

This page uses that function, if you need an example: [Yahoo Search Plugins](https://www.userchrome.org/yahooxml.html)
