mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-09-13 06:19:44 -05:00
Suppress any crash in requestPermission
This commit is contained in:
22
js/client.js
22
js/client.js
@@ -1325,16 +1325,18 @@
|
||||
// notifications
|
||||
|
||||
requestNotifications: function() {
|
||||
if (window.webkitNotifications && webkitNotifications.requestPermission) {
|
||||
// Notification.requestPermission crashes Chrome 23:
|
||||
// https://code.google.com/p/chromium/issues/detail?id=139594
|
||||
// In lieu of a way to detect Chrome 23, we'll just use the old
|
||||
// requestPermission API, which works to request permissions for
|
||||
// the new Notification spec anyway.
|
||||
webkitNotifications.requestPermission();
|
||||
} else if (window.Notification && Notification.requestPermission) {
|
||||
Notification.requestPermission(function(permission) {});
|
||||
}
|
||||
try {
|
||||
if (window.webkitNotifications && webkitNotifications.requestPermission) {
|
||||
// Notification.requestPermission crashes Chrome 23:
|
||||
// https://code.google.com/p/chromium/issues/detail?id=139594
|
||||
// In lieu of a way to detect Chrome 23, we'll just use the old
|
||||
// requestPermission API, which works to request permissions for
|
||||
// the new Notification spec anyway.
|
||||
webkitNotifications.requestPermission();
|
||||
} else if (window.Notification && Notification.requestPermission) {
|
||||
Notification.requestPermission(function(permission) {});
|
||||
}
|
||||
} catch (e) {}
|
||||
},
|
||||
notifications: null,
|
||||
notify: function(title, body, tag, once) {
|
||||
|
||||
Reference in New Issue
Block a user