googlearchive / polymer-gestures

84 stars 27 forks source link

Fullscreen on tap #58

Closed nomego closed 10 years ago

nomego commented 10 years ago

It seems like there's a security feature that only allows requesting fullscreen on a click-event.

This, combined with the on-tap implementation makes the following code not work:

<paper-icon-button id="fullscreenButton" icon="fullscreen" on-tap="{{ toggleFullscreen }}"></paper-icon-button>

But instead, this (on-click) works for both desktop and mobile (chrome):

<paper-icon-button id="fullscreenButton" icon="fullscreen" on-click="{{ toggleFullscreen }}"></paper-icon-button>

Is is possible to make on-tap able to trigger a secure enter fullscreen request?

vilasmaciel commented 10 years ago

on-click event is no longer being triggered for mobile (chrome)

kenchris commented 10 years ago

You can use mouseup instead like I am doing here:

https://gist.github.com/kenchris/f54865ce82f5be76fe52

dfreedm commented 10 years ago

No, there's no way to trigger a trusted event to fire in script, as that would be counter to the security model.

You can use down or up events, which are synchronous with mousedown, touchstart, and mouseup, touchend respectively.