5

I went through more than 10 questions with same content but not to find a updated answer. (world of web is changing rapidly I guess). First thing is, is it possible to put current window full screen simulating F11 press on a user button click. also what is the best practice for doing it if I want the function to work in all major browsers (IE, FF, Chrome and Safari).

How to make in Javascript full screen windows (stretching all over the screen)

Simulate F11 with javascript

onclick go full screen

including above links I went through lot of questions but had no susses. Its really helpful if someone can come up with an idea. Thanks.

Community
  • 1
  • 1
DbxD
  • 540
  • 2
  • 15
  • 29
  • Short answer: Not possible, the way you want it. The links you provided are as good as it gets. Alternative answer: Do NOT mess with my main browser window. Open a new one, please – mplungjan Aug 06 '13 at 08:53
  • It was possible earlier, isn't it? in this case I want to re-size the current window by offering the user go to full screen button. – DbxD Aug 06 '13 at 08:55
  • It was never possible to remove chrome from current window. IE allows(allowed) to open a new window and kill the current window which is something I call Denial Of Service if you do that to my window. I STRONGLY prefer a new window or do it like Chrome does [here](http://johndyer.name/native-fullscreen-javascript-api-plus-jquery-plugin/) – mplungjan Aug 06 '13 at 09:00
  • well. I'm referring to the functionality of F11 key. my button is just supposed to be a virtual F11 key. – DbxD Aug 06 '13 at 09:06
  • 1
    like this? http://fiddle.jshell.net/WWFXW/6/show/light/ see the implementation: http://jsfiddle.net/WWFXW/6/ fsapi in first link of @ZaoTaoBao answer is very complete btw. Keep in mind that browser support is quite limited at the moment. Also, https://developer.mozilla.org/en-US/docs/Web/Guide/DOM/Using_full_screen_mode – j03w Aug 06 '13 at 09:22
  • 1
    That is the Chrome/Safari thing I mentioned. It works quite like F11 @j03w why not add as answer? – mplungjan Aug 06 '13 at 09:24
  • Thanks, I works for going fulls screen, but i want to refresh on full screen. as soon as I refresh it full screen is gone. any idea to get rid of that. – DbxD Aug 06 '13 at 09:31
  • you can try reloading the data using ajax – mplungjan Aug 06 '13 at 09:35
  • no luck there, want to do in in .js file – DbxD Aug 06 '13 at 10:01

2 Answers2

3

maybe this can help you example of full screen using the blog post Native Fullscreen JavaScript API (plus jQuery plugin)

mplungjan
  • 169,008
  • 28
  • 173
  • 236
ZaoTaoBao
  • 2,567
  • 2
  • 20
  • 28
  • no, I want entire page full screen when user press the goTofullScreen Button. – DbxD Aug 06 '13 at 09:03
  • See the link I added. Safari and Chrome supports that – mplungjan Aug 06 '13 at 09:05
  • 1
    Thanks, This also works for going fulls screen, but i want to refresh on full screen. as soon as I refresh it full screen is gone. any idea to get rid of that. – DbxD Aug 06 '13 at 09:32
  • @Vixed, nope, had to stop refreshing. this is an old question. There might be a new solution now. Good luck finding that. – DbxD Sep 22 '17 at 19:51
1

This question is possibly a duplicate of a question you linked to. The latest cross-browser solution is:

function requestFullScreen(elt) {
    console.log("Requesting fullscreen for", elt);
    if (elt.requestFullscreen) {
        elt.requestFullscreen();
    } else if (elt.msRequestFullscreen) {
        elt.msRequestFullscreen();
    } else if (elt.mozRequestFullScreen) {
        elt.mozRequestFullScreen();
    } else if (elt.webkitRequestFullscreen) {
        elt.webkitRequestFullscreen();
    } else {
        console.error("Fullscreen not available");
    }
}

Please note that this is "experimental technology" as of this post. See this answer and this MDN page for more details.

Community
  • 1
  • 1
Luke
  • 18,811
  • 16
  • 99
  • 115