Start asynchronous initialization.
The callback is triggered once initialization is complete, which may be
immediately, if initialization has already been completed by some previous
call to this method. The callback is always invoked asynchronously.
aObserver | An optional object observing the end of initialization. |
Adds a new search engine from the file at the supplied URI, optionally
asking the user for confirmation first. If a confirmation dialog is
shown, it will offer the option to begin using the newly added engine
right away.
@throws NS_ERROR_FAILURE if the type is invalid, or if the description
file cannot be successfully loaded.
engineURL | The URL to the search engine's description file. |
dataType | An integer representing the plugin file format. Must be one of the supported search engine data types defined above. |
iconURL | A URL string to an icon file to be used as the search engine's icon. This value may be overridden by an icon specified in the engine description file. |
confirm | A boolean value indicating whether the user should be asked for confirmation before this engine is added to the list. If this value is false, the engine will be added to the list upon successful load, but it will not be selected as the current engine. |
callback | A nsISearchInstallCallback that will be notified when the addition is complete, or if the addition fails. It will not be called if addEngine throws an exception. |
Adds a new search engine, without asking the user for confirmation and
without starting to use it right away.
name | The search engine's name. Must be unique. Must not be null. |
iconURL | Optional: A URL string pointing to the icon to be used to represent the engine. |
alias | Optional: A unique shortcut that can be used to retrieve the search engine. |
description | Optional: a description of the search engine. |
method | The HTTP request method used when submitting a search query. Must be a case insensitive value of either "get" or "post". |
url | The URL to which search queries should be sent. Must not be null. |
extensionID | [optional] Optional: The correct extensionID if called by an add-on. |
Un-hides all engines installed in the directory corresponding to
the directory service’s NS_APP_SEARCH_DIR key. (i.e. the set of
engines returned by getDefaultEngines)
Returns an engine with the specified alias.
alias | The search engine's alias. |
The corresponding nsISearchEngine object, or null if it doesn't exist. |
Returns an engine with the specified name.
aEngineName | The name of the engine. |
The corresponding nsISearchEngine object, or null if it doesn't exist. |
Returns an array of all installed search engines.
an array of nsISearchEngine objects. |
Returns an array of all installed search engines whose hidden attribute is
false.
an array of nsISearchEngine objects. |
Returns an array of all default search engines. This includes all loaded
engines that aren’t in the user’s profile directory
(NS_APP_USER_SEARCH_DIR).
an array of nsISearchEngine objects. |
Moves a visible search engine.
@throws NS_ERROR_FAILURE if newIndex is out of bounds, or if engine is
hidden.
engine | The engine to move. |
newIndex | The engine's new index in the set of visible engines. |
Removes the search engine. If the search engine is installed in a global
location, this will just hide the engine. If the engine is in the user’s
profile directory, it will be removed from disk.
engine | The engine to remove. |
Determines if the provided URL represents results from a search engine, and
provides details about the match.
The lookup mechanism checks whether the domain name and path of the
provided HTTP or HTTPS URL matches one of the known values for the visible
search engines. The match does not depend on which of the schemes is used.
The expected URI parameter for the search terms must exist in the query
string, but other parameters are ignored.
url | String containing the URL to parse, for example "https://www.google.com/search?q=terms". |
Determine whether initialization has been completed.
Clients of the service can use this attribute to quickly determine whether
initialization is complete, and decide to trigger some immediate treatment,
to launch asynchronous initialization or to bailout.
Note that this attribute does not indicate that initialization has succeeded.
@return |true| if the search service is now initialized, |false| if
initialization has not been triggered yet.
The default search engine. Returns the first visible engine if the default
engine is hidden. May be null if there are no visible search engines.
The currently active search engine. May be null if there are no visible
search engines.