File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,16 +111,21 @@ var LibraryHTML5 = {
111111 } ,
112112
113113 canPerformEventHandlerRequests ( ) {
114+ // Browsers that support navigator.userActivation.isActive: https://developer.mozilla.org/en-US/docs/Web/API/UserActivation/isActive
115+ #if MIN_CHROME_VERSION < 72 || MIN_FIREFOX_VERSION < 120 || MIN_SAFARI_VERSION < 160400
114116 if ( navigator . userActivation ) {
115117 // Verify against transient activation status from UserActivation API
116118 // whether it is possible to perform a request here without needing to defer. See
117119 // https://developer.mozilla.org/en-US/docs/Web/Security/User_activation#transient_activation
118120 // and https://caniuse.com/mdn-api_useractivation
119- // At the time of writing, Firefox does not support this API: https://bugzil.la/1791079
120121 return navigator . userActivation . isActive ;
121122 }
122123
123124 return JSEvents . inEventHandler && JSEvents . currentEventHandler . allowsDeferredCalls ;
125+ #else
126+ // We are targeting modern browsers where navigator.userActivation.isActive is unconditionally supported.
127+ return navigator . userActivation . isActive ;
128+ #endif
124129 } ,
125130
126131 runDeferredCalls ( ) {
You can’t perform that action at this time.
0 commit comments