alarms.get()
Ruft einen Alarm ab, basierend auf seinem Namen.
Dies ist eine asynchrone Funktion, die ein Promise
zurückgibt.
Syntax
js
let getAlarm = browser.alarms.get(
name // optional string
)
Parameter
name
Optional-
string
. Der Name des Alarms, den Sie abrufen möchten. Wenn Sie diesen nicht angeben, wird der leere String "" verwendet.
Rückgabewert
Beispiele
js
function gotAlarm(alarm) {
if (alarm) {
console.log(alarm.name);
}
}
let getAlarm = browser.alarms.get("my-periodic-alarm");
getAlarm.then(gotAlarm);
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | ||||||
---|---|---|---|---|---|---|---|
get |
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.
Hinweis:
Diese API basiert auf der chrome.alarms
API von Chromium.