Closed kav2k closed 8 years ago
For future reference, "the update trick" is the thing that was introduced in e8f248954585bce042990b7102f4f166ff52b0a4, it works because chrome.notifications.update
synchronously throws an error if the API is not supported, and that regardless of whether the notification exists, the API call is accepted. If the notification does not exist (we use notification ID ""
), the callback (if provided) is called with the first parameter being false
.
Updated with suggestions.
Thanks for your work!
Using the update probing trick, this removes cascaded try-catch from the main showNotification() code.