火狐瀏覽器禁用滑鼠右鍵和複製?
- 2022-09-30
尊敬的使用者,您好!很高興為您答疑
禁用右鍵:oncontextmenu=“window。event。returnValue=false”;
禁止複製:oncopy=“return false;”oncut=“return false;”
不過這些對於有心進行您網站內容複製的人來說,沒有什麼實際的意義。目前比較流行的做法是在頁面加隱藏的混淆內容,增加內容竊取者的時間成本,降低其竊取精度。
希望我的回答對您有所幫助,如有疑問,歡迎繼續諮詢我們。
function key(){
if(event。shiftKey){
window。close();}
//禁止Shift
if(event。altKey){
window。close();}
//禁止Alt
if(event。ctrlKey){
window。close();}
//禁止Ctrl
return false;}
document。onkeydown=key;
if (window。Event)
document。captureEvents(Event。MOUSEUP);
function nocontextmenu(){
event。cancelBubble = true
event。returnValue = false;
return false;}
function norightclick(e){
if (window。Event){
if (e。which == 2 || e。which == 3)
return false;}
else
if (event。button == 2 || event。button == 3){
event。cancelBubble = true
event。returnValue = false;
return false;}
}
//禁右鍵
document。oncontextmenu = nocontextmenu; // for IE5+
document。onmousedown = norightclick; // for all others
var omitformtags=[“input”, “textarea”, “select”]
omitformtags=omitformtags。join(“|”)
function disableselect(e){
if (omitformtags。indexOf(e。target。tagName。toLowerCase())==-1)
return false
}
function reEnable(){
return true
}
if (typeof document。onselectstart!=“undefined”)
document。onselectstart=new Function (“return false”)
else{
document。onmousedown=disableselect
document。onmouseup=reEnable
}
沒有啊 不過火狐有的時候要下一些外掛
上一篇:仙劍四存檔檔案能提取麼
下一篇:反拗危象是怎麼形成的