admin管理员组文章数量:1289893
Is there some way to hide the browser toolbar / statusbar etc in current window via javascript? I know I can do it in a popup with window.open()
but I need to do it this way. Is it possible at all?
Is there some way to hide the browser toolbar / statusbar etc in current window via javascript? I know I can do it in a popup with window.open()
but I need to do it this way. Is it possible at all?
6 Answers
Reset to default 3As per the previous answer, this isn't possible to my knowledge and is best avoided anyway. Even if a solution can be found, bear in mind that most browsers these days allow the user to prevent Javascript from interfering with their browser settings and window chrome, even when using window.open. So you've got absolutely no way of guarenteeing the behaviour that you're looking for and consequently you're best off forgetting about it altogether. Let the user decide how they want their window configured.
I believe this is not possible. And anyway, just don't do it. Your page can do what it wants with the rendering area, but the rest of the browser belongs to the user and websites have no business messing with it.
Marijn: ok thanks. This is for an intranet site and we display InfoPath forms as separate, no-toolbar, no-statusbar windows. This is a client requirement, I'm not trying to do evil ;)
To Martin Meredith, Luke, Marijn: thanks for your quick reply. It is now settled that it's not possible.
I agree with you all about this being an undesirable behavior, but as i stated before, this is for a bank intranet application where all users are running a tightly controlled, centrally-configured, customized and hacked to death browser they have no control over anyway, and the client actually wants this behavior for the application. It would be dumb and annoying to do this in a public facing/general website, of course. But sometimes we just have to get the job done :(
No. This would be a massive security hole if it were possible... not to mention annoying.
My browser wont even let you do this in popups... which can be annoying aswell!
You may want to investigate using an HTA (HTML Application).
It will render HTML pages with zero browser chrome, a custom icon can be shown on the task bar, and the entire "caption" can be removed. The last option yields a floating window without eve a close button.
For how I imagine your needs to be, you would want to start with something like:
<html>
<head>
<title>HTA Demonstration</title>
<hta:application innerborder="no" icon="magnify.exe" />
</head>
<body style="overflow: hidden; margin: 0;">
<iframe src="http://www.yahoo." style="width: 100%; height: 100%;"></iframe>
</body>
</html>
Save the above HTML into a file and give it "example.hta" as the file name. You'll then have a generic icon on your desktop which you can double click on to start.
<hta:application innerborder="no" caption="no" icon="magnify.exe" />
This change will remove the title bar when running the script. Press Alt-F4 to exit the script if you do this.
This will also only work with IE, however that should not be an issue on an intranet.
本文标签: user interfaceHiding toolbarstatus bar with javascript in CURRENT browser windowStack Overflow
版权声明:本文标题:user interface - Hiding toolbarstatus bar with javascript in CURRENT browser window? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741488156a2381498.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论