close
創作或解題的心血,被人無情的轉載複製,是許多創作者的痛。
雖然痞克邦的後台管理有「防止右鍵」,但我試過手機、筆電真的沒有用,還是可以複製文章,真的是有點傻眼。
Google 網路教學「如何防止網頁全選、複製」寫的內容,實在是有看沒有懂(因為我不是專業的寫程式的人,只看得懂VBA的程式)
但經過一些 Try and Error 的實驗測試,終於知道要如何使用。
當你完成你的創作後。在文章尾按下 </>HTML 按鈕 (如下圖)。
然後貼上以下程式語言,即可暫時保護你的心血,因為還是有其他方法去破解。(真是創作悲哀T^T)
方法一:
<style type="text/css"> body { -moz-user-select : none; -webkit-user-select: none; } </style> <script type="text/javascript"> function iEsc(){ return false; } function iRec(){ return true; } function DisableKeys() { if(event.ctrlKey || event.shiftKey || event.altKey) { window.event.returnValue=false; iEsc();} } document.ondragstart=iEsc; document.onkeydown=DisableKeys; document.oncontextmenu=iEsc; if (typeof document.onselectstart !="undefined") document.onselectstart=iEsc; else{ document.onmousedown=iEsc; document.onmouseup=iRec; } function DisableRightClick(qsyzDOTnet){ if (window.Event){ if (qsyzDOTnet.which == 2 || qsyzDOTnet.which == 3) iEsc();} else if (event.button == 2 || event.button == 3){ event.cancelBubble = true event.returnValue = false; iEsc();} } </script>
方法二:
<style type="text/css"> body { -moz-user-select : none; -webkit-user-select: none; } </style> document.oncontextmenu=new Function("event.returnValue=false"); document.onselectstart=new Function("event.returnValue=false");
注意:使用HTML語法後,會連同你在編輯網頁都無法使用右鍵、全選、複製。所以在使用語法前,請三思而後行。
全站熱搜