management.getSelf()
语法
js
let gettingSelf = browser.management.getSelf()
参数
无。
返回值
Promise
,会兑现为包含有关附加组件的信息的 ExtensionInfo
对象。
浏览器兼容性
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.
示例
打印附加组件的名称:
js
function gotSelf(info) {
console.log(`附加组件名:${info.name}`);
}
const gettingSelf = browser.management.getSelf();
gettingSelf.then(gotSelf);
备注:
该 API 基于 Chromium 的 chrome.management
API。本文衍生自 Chromium 代码中的 management.json
。