management.getSelf()
Ruft ein ExtensionInfo
-Objekt ab, das Informationen über das aufrufende Add-on enthält.
Diese API erfordert nicht die "management" API-Berechtigung.
Dies ist eine asynchrone Funktion, die ein Promise
zurückgibt.
Syntax
js
let gettingSelf = browser.management.getSelf()
Parameter
Keine.
Rückgabewert
Ein Promise
das mit einem ExtensionInfo
-Objekt erfüllt wird, das Informationen über das Add-on enthält.
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | ||||||
---|---|---|---|---|---|---|---|
getSelf |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No 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
Protokolliert den Namen des Add-ons:
js
function gotSelf(info) {
console.log(`Add-on name: ${info.name}`);
}
const gettingSelf = browser.management.getSelf();
gettingSelf.then(gotSelf);
Hinweis:
Diese API basiert auf der chrome.management
API von Chromium. Diese Dokumentation wurde aus management.json
im Chromium-Code abgeleitet.