Is it possible to disable the "You've gone full screen" notification in javascript or jquery? - Stack

I'm building a HTML5 game but if I set the game into fullscreen if my cursor on the top it shows t

I'm building a HTML5 game but if I set the game into fullscreen if my cursor on the top it shows that notification?
I use this to set it into fullscreen:

function toggleFullScreen() {
      if (!document.fullscreenElement &&
          !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement ) {
        if (document.documentElement.requestFullscreen) {
          document.documentElement.requestFullscreen();
        } else if (document.documentElement.msRequestFullscreen) {
          document.documentElement.msRequestFullscreen();
        } else if (document.documentElement.mozRequestFullScreen) {
          document.documentElement.mozRequestFullScreen();
        } else if (document.documentElement.webkitRequestFullscreen) {
          document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
        }
      } else {
        if (document.exitFullscreen) {
          document.exitFullscreen();
        } else if (document.msExitFullscreen) {
          document.msExitFullscreen();
        } else if (document.mozCancelFullScreen) {
          document.mozCancelFullScreen();
        } else if (document.webkitExitFullscreen) {
          document.webkitExitFullscreen();
        }
      }
    }

Thanks!

I'm building a HTML5 game but if I set the game into fullscreen if my cursor on the top it shows that notification?
I use this to set it into fullscreen:

function toggleFullScreen() {
      if (!document.fullscreenElement &&
          !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement ) {
        if (document.documentElement.requestFullscreen) {
          document.documentElement.requestFullscreen();
        } else if (document.documentElement.msRequestFullscreen) {
          document.documentElement.msRequestFullscreen();
        } else if (document.documentElement.mozRequestFullScreen) {
          document.documentElement.mozRequestFullScreen();
        } else if (document.documentElement.webkitRequestFullscreen) {
          document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
        }
      } else {
        if (document.exitFullscreen) {
          document.exitFullscreen();
        } else if (document.msExitFullscreen) {
          document.msExitFullscreen();
        } else if (document.mozCancelFullScreen) {
          document.mozCancelFullScreen();
        } else if (document.webkitExitFullscreen) {
          document.webkitExitFullscreen();
        }
      }
    }

Thanks!

Share Improve this question asked Jan 23, 2015 at 17:17 TamásTamás 1,1122 gold badges12 silver badges30 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 6

To the extent of my knowledge, this is not possible in javascript. The browser handles the showing of that notification to prevent websites from exploiting the user by going fullscreen without informing them, not showing them how to close it nor allowing them to.

Check out this answer for a bit more in-depth information: https://superuser./questions/398945/disable-the-youve-gone-full-screen-notification-in-chrome

Also: https://groups.google./a/webmproject/forum/#!topic/webm-discuss/5vtRCwu50ZU

I believe that, by design, it is not possible so that an application cannot takeover the screen for nefarious purposes.

No, you cant..it's one of the default functionality of a browser. it's one of the security features implemented in browsers..

See more here https://groups.google./a/webmproject/forum/#!topic/webm-discuss/5vtRCwu50ZU

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745392774a4625739.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信