runtime.getPlatformInfo()
Gibt Informationen über die aktuelle Plattform zurück. Dies ist eine asynchrone Funktion, die ein Promise
zurückgibt.
Syntax
js
let getting = browser.runtime.getPlatformInfo()
Parameter
Keine.
Rückgabewert
Ein Promise
, das mit einem runtime.PlatformInfo
-Wert erfüllt wird, der die aktuelle Plattform repräsentiert.
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | ||||||
---|---|---|---|---|---|---|---|
getPlatformInfo |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on 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.
Beispiele
Abrufen und Protokollieren des Plattformbetriebssystems:
js
function gotPlatformInfo(info) {
console.log(info.os);
}
let gettingInfo = browser.runtime.getPlatformInfo();
gettingInfo.then(gotPlatformInfo);
Hinweis:
Diese API basiert auf Chromiums chrome.runtime
API. Diese Dokumentation ist abgeleitet von runtime.json
im Chromium-Code.