Fix IE Edge compatibility on notification button clicks

This commit is contained in:
shortcutme 2018-06-28 02:39:46 +02:00
parent ff85241962
commit 1ca2b40bf9
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
2 changed files with 7 additions and 5 deletions

View file

@ -29,7 +29,7 @@ class Wrapper
@opener_tested = false @opener_tested = false
@announcer_line = null @announcer_line = null
@allowed_event_constructors = [MouseEvent, KeyboardEvent] # Allowed event constructors @allowed_event_constructors = [window.MouseEvent, window.KeyboardEvent, window.PointerEvent] # Allowed event constructors
window.onload = @onPageLoad # On iframe loaded window.onload = @onPageLoad # On iframe loaded
window.onhashchange = (e) => # On hash change window.onhashchange = (e) => # On hash change
@ -49,7 +49,8 @@ class Wrapper
throw "Event not trusted" throw "Event not trusted"
if e.originalEvent.constructor not in @allowed_event_constructors if e.originalEvent.constructor not in @allowed_event_constructors
throw "Invalid event constructor: #{e.constructor} != #{allowed_event_constructor}" debugger
throw "Invalid event constructor: #{e.constructor} not in #{JSON.stringify(@allowed_event_constructors)}"
if e.originalEvent.currentTarget != allowed_target[0] if e.originalEvent.currentTarget != allowed_target[0]
throw "Invalid event target: #{e.originalEvent.currentTarget} != #{allowed_target[0]}" throw "Invalid event target: #{e.originalEvent.currentTarget} != #{allowed_target[0]}"

View file

@ -714,7 +714,6 @@ jQuery.extend( jQuery.easing,
}).call(this); }).call(this);
/* ---- src/Ui/media/Notifications.coffee ---- */ /* ---- src/Ui/media/Notifications.coffee ---- */
@ -896,7 +895,7 @@ jQuery.extend( jQuery.easing,
this.address = null; this.address = null;
this.opener_tested = false; this.opener_tested = false;
this.announcer_line = null; this.announcer_line = null;
this.allowed_event_constructors = [MouseEvent, KeyboardEvent]; this.allowed_event_constructors = [window.MouseEvent, window.KeyboardEvent, window.PointerEvent];
window.onload = this.onPageLoad; window.onload = this.onPageLoad;
window.onhashchange = (function(_this) { window.onhashchange = (function(_this) {
return function(e) { return function(e) {
@ -928,7 +927,8 @@ jQuery.extend( jQuery.easing,
throw "Event not trusted"; throw "Event not trusted";
} }
if (ref = e.originalEvent.constructor, indexOf.call(this.allowed_event_constructors, ref) < 0) { if (ref = e.originalEvent.constructor, indexOf.call(this.allowed_event_constructors, ref) < 0) {
throw "Invalid event constructor: " + e.constructor + " != " + allowed_event_constructor; debugger;
throw "Invalid event constructor: " + e.constructor + " not in " + (JSON.stringify(this.allowed_event_constructors));
} }
if (e.originalEvent.currentTarget !== allowed_target[0]) { if (e.originalEvent.currentTarget !== allowed_target[0]) {
throw "Invalid event target: " + e.originalEvent.currentTarget + " != " + allowed_target[0]; throw "Invalid event target: " + e.originalEvent.currentTarget + " != " + allowed_target[0];
@ -1731,6 +1731,7 @@ jQuery.extend( jQuery.easing,
}).call(this); }).call(this);
/* ---- src/Ui/media/WrapperZeroFrame.coffee ---- */ /* ---- src/Ui/media/WrapperZeroFrame.coffee ---- */