Asked by:
When I run my application I want my web browser to open automatically in fullscreen(F11) mode.

Question
-
User1778305386 posted
When I run my application I want my web browser to open automatically in fullscreen(F11) mode.
All pages open in full screen.(All over the Application)
Thursday, May 29, 2014 9:35 AM
All replies
-
User-225949985 posted
The code to set fullscreen is something like this:
<script type="text/javascript"> function requestFullScreen(element) { // Supports most browsers and their versions. var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullScreen; if (requestMethod) { // Native full screen. requestMethod.call(element); } else if (typeof window.ActiveXObject !== "undefined") { // Older IE. var wscript = new ActiveXObject("WScript.Shell"); if (wscript !== null) { wscript.SendKeys("{F11}"); } } } var elem = document.body; // Make the body go full screen. requestFullScreen(elem); </script>
But I don't think it's possible to trigger it when the page loads, beacuse it needs to be attached to an event handler on a page element (a button click, for instance).
You might want to check this link to further understand:
Thursday, May 29, 2014 10:40 AM -
User1778305386 posted
i want fullscreen on page load but this code is not work.
This code is work but on button click but i want on page load give me solution:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test2.aspx.cs" Inherits="test2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title><script type="text/javascript">
function goFullscreen(element) {
if (element.mozRequestFullScreen) {
// This is how to go into fullscren mode in Firefox
// Note the "moz" prefix, which is short for Mozilla.
element.mozRequestFullScreen();
} else if (element.webkitRequestFullScreen) {
// This is how to go into fullscreen mode in Chrome and Safari
// Both of those browsers are based on the Webkit project, hence the same prefix.
element.webkitRequestFullScreen();
}
// Hooray, now we're in fullscreen mode!
}// var element = document.body; // Make the body go full screen.
// requestFullScreen(element);</script>
</head>
<body>
<form id="form1" runat="server">
<div><asp:Button ID="Button1" runat="server" Text="Button"
onclick="Button1_Click" OnClientClick="goFullscreen(document.documentElement);return false"/>
</div>
</form>
</body>
</html>Saturday, May 31, 2014 4:08 PM -
User753101303 posted
Hi,
If this is for something like a kiosk mode you generally have a command line switch allowing to enable this. Else the user should be left in control of deciding wether or not he wants to show your site in full screen mode. Anyway I believe this is a safety measure and that you have no way around this (precisely to let the user to control this especially for safety reasons, else a bad guy could fake whatever he wants and fool some users, for example showing a lock screen and let the user to post his password or whatever).
Saturday, May 31, 2014 5:14 PM