让页面没有地址栏、状态栏、工具栏
l 在ie中必须将域名或者ip添加到可信任。不然地址栏去不掉。
l 在登录页或者系统入口页中弹出窗口并关闭原窗口。
(function() { var url = window.location.href; if(url.indexOf('isreload')==-1){ if (url.indexOf("\?") != -1) { url=url.substring(0,url.indexOf("\?")); } url += "?isreload=1"; var newWindow = window.open(url,'loginWindow','toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,status=no'); newWindow.moveTo(0, 0); newWindow.resizeTo(screen.availWidth, screen.availHeight); window.open('close.html', '_self'); return; } })();
Close.html
<html><body>
<script type="text/javascript">window.close();</script>
</body></html>
l 在session失效、注销系统等返回系统入口页时,主要要在跳转url中加上isreload标识,不然会导致入口页面关闭。
l 目前还存在标题栏中会保留URL的问题。因为安全限制原因,标题栏中的URL和地址栏必须有一个存在。如果系统允许全屏显示,可以通过页面的全屏显示来屏蔽此问题。但是也没有从根本上解决,只是不显示标题栏了。
禁用右键菜单、前进、后退、页面刷新
l 在页面的onload事件中添加如下处理。
function my_disable_button(){
window.history.forward(1);
var message="Sorry, right-click has been disabled";
//alert("it is coming!!");
/// Functions
function clickIE() {
if (document.all && (event.srcElement.form == null || event.srcElement.isTextEdit == false)) {
return false;
}
}
function clickNS(e) {
if (document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {
return false;
}
}
}
function cancelBack(){
//alert(message);
if(window.event && window.event.keyCode == 116)
{ // Capture and remap F5
window.event.keyCode = 505;
}
if(window.event && window.event.keyCode == 505){ // New action for F5
return false;
// Must return false or the browser will refresh anyway
}
// 8 backspace, 37 left arrow, 39 right arrow, 116 F5, 122 F11, CTRL-N, CTRL-R
if( (
(window.event.keyCode == 8)
|| (window.event.keyCode == 37 && window.event.altKey)
|| (window.event.keyCode == 39 && window.event.altKey)
)
&& (event.srcElement.form == null || event.srcElement.isTextEdit == false))
{
event.cancelBubble = true;
event.returnValue = false;
//alert('Backspace, Alt+leftarrow, or Alt+rightarrow called');
} else if(
(window.event.keyCode == 116 )
|| (window.event.keyCode == 122)
|| (window.event.ctrlKey && (window.event.keyCode == 78 || window.event.keyCode == 82))){
event.cancelBubble = true;
event.returnValue = false;
//alert('F5, F11, Ctrl+N, or Ctrl+R called');
}
}
/// Calls
document.οncοntextmenu=new Function("return false");
if (document.layers) {
//alert("flag 1.");
document.captureEvents(Event.MOUSEDOWN);
document.οnmοusedοwn=clickNS;
} else {
//alert("flag 2.");
document.οnmοuseup=clickNS;
document.οncοntextmenu=clickIE;
}
document.οnkeydοwn=cancelBack;
}
l 注意在ADF框架中,需要将af:document组件的clientCompenent属性设置为true,然后触发af:clientListener中的onload事件。