File tree 2 files changed +9
-2
lines changed
packages/messaging/src/controllers
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1
1
/**
2
2
* @license
3
- * Copyright 2017 Google Inc.
3
+ * Copyright 2017 Google LLC
4
4
*
5
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
6
* you may not use this file except in compliance with the License.
@@ -277,6 +277,11 @@ describe('SwController', () => {
277
277
} ) ;
278
278
279
279
it ( 'warns if there are more action buttons than the browser limit' , async ( ) => {
280
+ // This doesn't exist on Firefox:
281
+ // https://developer.mozilla.org/en-US/docs/Web/API/notification/maxActions
282
+ if ( ! Notification . maxActions ) {
283
+ return ;
284
+ }
280
285
stub ( Notification , 'maxActions' ) . value ( 1 ) ;
281
286
282
287
const warnStub = stub ( console , 'warn' ) ;
Original file line number Diff line number Diff line change 1
1
/**
2
2
* @license
3
- * Copyright 2017 Google Inc.
3
+ * Copyright 2017 Google LLC
4
4
*
5
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
6
* you may not use this file except in compliance with the License.
@@ -339,6 +339,8 @@ function showNotification(details: NotificationDetails): Promise<void> {
339
339
const title = details . title ?? '' ;
340
340
341
341
const { actions } = details ;
342
+ // Note: Firefox does not support the maxActions property.
343
+ // https://developer.mozilla.org/en-US/docs/Web/API/notification/maxActions
342
344
const { maxActions } = Notification ;
343
345
if ( actions && maxActions && actions . length > maxActions ) {
344
346
console . warn (
You can’t perform that action at this time.
0 commit comments