You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2022/09/22 01:58:32 UTC

[GitHub] [cordova-plugin-screen-orientation] breautek commented on issue #81: can't call element.requestFullscreen() inside orientation change listener

breautek commented on issue #81:
URL: https://github.com/apache/cordova-plugin-screen-orientation/issues/81#issuecomment-1254415560

   User gestures are trusted events, triggered by the browser on the behalf of the user.
   
   Unfortunately, polyfills are not considered trusted user events, because they tend to be emitted programmatically, outside of a trusted user event callstack. This includes any cordova events because these events, while may come from a user gesture, it is coming from outside the browser environment from native code, and thus not a trusted user event. This is a browser safety mechanism to prevent developers abusing APIs and to give a poor user experience that cannot be disabled.
   
   If an API requires a trusted user event/gesture, then it must come from a legit click/touch callback (or any native browser event that the user triggers and the API must be called without any asynchronous breaks (e.g. using `setTimeout` inside a click event will lift the API call from a trusted user event callstack and thus will fail the user gesture check).
   
   Closing because this isn't something that can be addressed.
   
   Modern browsers have pretty good support for [screen orientations](https://caniuse.com/?search=orientation) so a modern solution might be to simply not use this plugin and use the native browser API instead.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org