addSearchEngine method (sidebar)
Installs a Sherlock formatted search engine plugin into the browser application.
This method allows adding your custom search engine to the user search provider list.
Note that the Sherlock formatted search engine plugins are only supported by Firefox, while the OpenSearch description format are widely supported.
Use the AddSearchProvider method instead of the addSearchEngine method.
Syntax:
You can find the related objects in the Supported by objects section below.
Parameters:
Required. String that specifies the URL of the search engine plugin (.src). | |||||||
Required. String that specifies the URL of the icon associated with the plugin. | |||||||
Required. String that specifies the message to show when prompting the user for permission to install the plugin. | |||||||
Required. Not used. Set to null. |
Return value:
This method has no return value.
Example HTML code 1:
This example illustrates the use of the addSearchEngine method.
|
|||
<head> <script type="text/javascript"> function AddSearch () { if (window.sidebar) { // Firefox window.sidebar.addSearchEngine ('http://example.com/searchEngine.src', 'http://example.com/searchEngine.ico', 'Example Search Engine', null); } } </script> </head> <body> <button onclick="AddSearch ()">Add search engine</button> </body> |
|||
|
|||
Did you find this example helpful?
|
Example HTML code 2:
This example illustrates the use of the AddSearchProvider method.
|
|||||
<head> <script type="text/javascript"> function AddSearch () { if (window.external && ('AddSearchProvider' in window.external)) { window.external.AddSearchProvider ("/external/examples/common/xml/searchProvider.xml"); } else { alert ("Your browser does not support the AddSearchProvider method!"); } } </script> </head> <body> <button onclick="AddSearch ()">Add search engine</button> <br /><br /> To manage search engines, open the drop-down menu of your browser's Search Box (Firefox and Internet Explorer) or select Options/Basics/Default Search/Manage (Google Chrome). </body> |
|||||
|
|||||
Did you find this example helpful?
|
Supported by objects:
Related pages:
External links:
User Contributed Comments