Returns information about the browser in which this add-on is installed.
Syntax
chrome.runtime.getBrowserInfo( function(browserInfo) {...} // function )
This API is also available as browser.runtime.getBrowserInfo()
in a version that returns a promise.
Parameters
callback
function
. The function is passed the following arguments:-
browserInfo
- An object with the following properties:
-
name
: string value representing the browser name, for example "Firefox".vendor
: string value representing the browser's vendor, for example "Mozilla".version
: string representing the browser's version, for example "51.0" or "51.0a2".buildID
: string representing the specific build of the browser, for example "20161018004015".
Browser compatibility
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Chrome | Edge | Firefox | Firefox for Android | Opera | |
---|---|---|---|---|---|
Basic support | No | No | 51.0 | 51.0 | No |
Examples
Get and log the browser's name:
function gotBrowserInfo(info) { console.log(info.name); } chrome.runtime.getBrowserInfo(gotBrowserInfo);
Acknowledgements
Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.