1

I can make any window go full-screen with the code here just fine, but the catch is making a parent window user-event apply to any child window(s).

When I try to do something like this in the parent:

$("#maximize").click(function(event){
var child = window.open("window.php", "test", "toolbar=0,location=0,menubar=0");

child.focus();
setTimeout(function() {requestFullScreen(child);}, 1000);
)};

I get this error in the child console, "Request for full-screen was denied because Element.mozRequestFullScreen() was not called from inside a short running user-generated event handler". I understand that's for security reasons, but the button click is user-generated; it was just generated in the parent.

I suspect it has to do with the timeout callback, but if I remove it, the child seems to flash fullscreen then go back to windowed or try to go fullscreen before it has proper focus, in which case I get this in the child console, "Request for full-screen was denied because requesting element is not in the currently focused tab". Seems like a "sleep();" is what I need as much as that's frowned upon.

Is there a way around this or are my users going to have to click maximize in each and every child window?

Community
  • 1
  • 1
Rogue14
  • 11
  • 4

0 Answers0