Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/subscriptionInit.js

Issue 29761562: Issue 6496 - Account for notifications.create() failing asynchronously (Closed)
Patch Set: Created April 25, 2018, 1:33 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/subscriptionInit.js
===================================================================
--- a/lib/subscriptionInit.js
+++ b/lib/subscriptionInit.js
@@ -145,11 +145,11 @@
// Firefox throws synchronously if the "buttons" option is provided.
// If buttons are supported (i.e. on Chrome), this fails with
- // a different error message due to missing required options.
+ // an asynchronous error due to missing required options.
// https://bugzilla.mozilla.org/show_bug.cgi?id=1190681
try
{
- browser.notifications.create({buttons: []});
+ browser.notifications.create({buttons: []}).catch(() => {});
}
catch (e)
{
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld