简体   繁体   中英

How to show a web page in full screen mode without statusbar and addressbar in all browsers?

如何在所有浏览器中以全屏方式显示没有状态栏和地址栏的网页,并且它也不应该显示任务栏。

You can't do this with JavaScript - and that's a good thing...I don't want a full screen advertisement in my face, do you?

Pseudo-out-of-browser plugins can do some of this though, Flash and Silverlight for example...but you can't do it with just a page and JavaScript. Browsers (especially newer ones) actively prevent most resizing and windows-without-bars behavior.

If I want MY browser to be in full screen mode, I will press F11.

It is MY browser. Not yours.

You cannot do this, as Javascript can only change things inside the webpage. It cannot change the behaviour of the browser itself.

You cannot do this in javascript. The reason is that someone might make a screen that looks like a windows lock screen and force users to type in their username/password. Its called phishing and illegal : http://en.wikipedia.org/wiki/Phishing . For right usage you can ask the user to opt into it (the user has to click a button) using Silverlight / Flash. However in this case the keys that function are limited. So you cannot get the user to type alphanumeric keys. Keys commonly used in games (eg space / arrow keys) will function. So will mouse clicks. With Silverlight if the user accepts you application to be Trusted (FullTrust) you can even capture all keys : http://timheuer.com/blog/archive/2009/11/18/whats-new-in-silverlight-4-complete-guide-new-features.aspx

I did not get what really you wants? You want code to your page OR manually you want to do with browsers.

If while browsing you want to do IE, Mozilla, Google chrome etc. will Do it with "F11" key (Short cut key)

(Highly NOT RECOMMENDED, but you can try * ) *If you want javascript for this, here it is...

<SCRIPT LANGUAGE="JavaScript">
function fullScreen(theURL) {
window.open(theURL, '', 'fullscreen=yes, scrollbars=auto');
}
</SCRIPT>

<--- BODY OF DOCUMENT -->

<body onload="fullScreen('popup_webpage.htm');">

this will open the webpage in new pop-up on page load.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM