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 GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
getPlatformInfo

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

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.