Browser 우클릭(드래그 복사) 방지 풀기
- Mouse Right click block disable
//------------------------
* chrome
* Drag free 드래그프리(마우스 드래그 & 마우스 우클릭 해제) (devroid.com)
chrome.google.com/webstore/detail/drag-freemouse-drag-mouse/cnfngpgfjllafbghaimjcmailafcdhod
//---------------------------------
* Firefox
- addon(부가 기능 설치)
* Absolute Enable Right Click & Copy
https://addons.mozilla.org/en-US/firefox/addon/absolute-enable-right-click/
* Enable Right Click and Copy
https://addons.mozilla.org/ko/firefox/addon/enable-rightclick-and-copy/
* GreaseMonkey (파이어폭스 애드온)
- 크롬의 경우 : Tampermonkey 확장 프로그램 설치
- 스크립트 설치
http://userscripts-mirror.org/scripts/show/90149
- 소스
// ==UserScript==
// @name Right-Click Enabler for some WebPortals
// @namespace http://userscript.org/users/oloklir
// @description Enables right-click and drag in "Naver Blog, Naver Cafe, Daum Blog, Daum Cafe, Cyworld Blog". Other sites can be added by updates.
// @copyright OLokLiR (http://oloklir.tistory.com/)
// @homepage http://userscripts.org/scripts/show/90149
// @updateURL https://userscripts.org/scripts/source/90149.meta.js
// @downloadURL https://userscripts.org/scripts/source/90149.user.js
// @version 0.531
// @license http://creativecommons.org/licenses/by-nc-sa/3.0/
// @injectframes 100
// @include http://*
// @include https://*
// @include http://*.naver.com/*
// @include http://*.daum.net/*
// @include http://*.cyworld.com/*
// @enable true
// ==/UserScript==
(function(){
var domain=window.location.host;
var unsafeWindow=this['unsafeWindow']||window;
//Naver enabling script from (http://userscripts.org/scripts/show/61326)
//Original Author : Dong-yoon Han (http://userscripts.org/users/dyhan81)
//Naver Blog, Naver Cafe
if(/blog\.naver\.com/i.test(domain)||/cafe\.naver\.com/i.test(domain)){
var intervalText="\
if(window.AutoSourcing!=null){\
var trueFnc='\
var e=window.event;\
if(e.allowDefault)\
e.returnValue=true;\
e.cancelBubble=false;\
';\
AutoSourcing.copy=new Function(trueFnc);\
AutoSourcing.aftercopy=new Function(trueFnc);\
AutoSourcing.keydown=new Function(trueFnc);\
AutoSourcing.keypress=new Function(trueFnc);\
}\
";
if(/blog[.]/i.test(domain))\
";};
if(/cafe[.]/i.test(domain));\
obj.oncontextmenu=fnc;\
obj.onselectstart=fnc;\
obj.ondragstart=fnc;\
};\
if(window.CancelBlockMouseRight!=null){\
CancelBlockMouseRight();\
cancelBlockDragInFF();\
};\
if(window.mlayoutPhoto!=null){\
_enablemouse(parent.document);\
_enablemouse(window.mlayoutPhoto.oView);\
window.mlayoutPhoto.opt.allowRightMouseClick=true;\
};\
if(document.getElementById('content-area')&&(document.getElementById('content-area').oncontextmenu!=null)){\
document.getElementById('content-area').oncontextmenu=null;\
document.getElementById('content-area').onselectstart=null;\
document.getElementById('content-area').ondragstart=null;\
};\
";};
intervalText=intervalText.replace(/\t/g,"");
//For Any Browser(without Chrome)
setTimeout(intervalText,0);
var intervalID=setInterval(intervalText,500);
setTimeout("clearInterval("+intervalID+");",3000);
//For Chrome
intervalText='(function())();';
var preset=unsafeWindow.document.body.getAttribute("onmousemove");
unsafeWindow.document.body.setAttribute("preset_enabler",preset);
preset=(preset==null)?'':preset;
unsafeWindow.document.body.setAttribute("onmousemove",preset+";"+intervalText);
}
//Daum Cafe
else if(/cafe[0-9]*\.daum\.net/i.test(domain)){
if(/var block=function\(e\)/.test(document.head.innerHTML)){
var cutEvent=function(e){
if(e.stopImmediatePropagation)e.stopImmediatePropagation();
else if(e.stopPropagation)e.stopPropagation();
};//It may properly works only in DOM3 supporting browser(eg. >=FF9)
if(window.addEventListener){
document.body.addEventListener("selectstart",cutEvent,false);
document.body.addEventListener("dragstart",cutEvent,false);
document.body.addEventListener("contextmenu",cutEvent,false);
document.body.addEventListener("copy",cutEvent,false);
document.body.addEventListener("keydown",cutEvent,false);
document.body.addEventListener("keyup",cutEvent,false);
document.body.addEventListener("mousedown",cutEvent,false);
document.body.addEventListener("mouseup",cutEvent,false);
}
else if(document.attachEvent){
document.body.attachEvent("onselectstart",cutEvent);
document.body.attachEvent("ondragstart",cutEvent);
document.body.attachEvent("oncontextmenu",cutEvent);
document.body.attachEvent("oncopy",cutEvent);
document.body.attachEvent("onkeydown",cutEvent);
document.body.attachEvent("onkeyup",cutEvent);
document.body.attachEvent("onmousedown",cutEvent);
document.body.attachEvent("onmouseup",cutEvent);
}
var style=document.styleSheets;
try{
for(var i=0;i<document.styleSheets.length;i++){
try{
for(var j=0;j<document.styleSheets[i].cssRules.length;j++){
if(
/user-select/i.test(document.styleSheets[i].cssRules[j].cssText)
||/user-focus/i.test(document.styleSheets[i].cssRules[j].cssText)
||/user-input/i.test(document.styleSheets[i].cssRules[j].cssText)
){
document.styleSheets[i].deleteRule(j);
j--;
}
}}catch(e){}
}
}catch(e){}
}
var intervalText="(function(){\
if(document.oncontextmenu!=null)\
if(document.onkeydown!=null)\
if(document.onkeyup!=null)\
if(document.onmouseup!=null)\
if(document.onmousedown!=null)\
if(document.ondragstart!=null)\
if(document.onselectstart!=null)\
if(document.oncopy!=null)\
})()";
intervalText=intervalText.replace(/\t/g,"");
//For Any Browser
setTimeout(intervalText,0);
var intervalID=setInterval(intervalText,500);
setTimeout("clearInterval("+intervalID+");",3000);
}
//Daum Blog
else if(/blog\.daum\.net/i.test(domain)){
var intervalText="(function(){\
var allowContent=function(e){\
var e=window.event||e;\
if(e.allowDefault)\
e.returnValue=true;\
e.cancelBubble=false;\
};\
if(document.onmousedown!=null)\
if(window.blockContent!=null){\
if(document.addEventListener){\
document.addEventListener('selectstart',allowContent,false);\
document.addEventListener('dragstart',allowContent,false);\
document.addEventListener('contextmenu',allowContent,false);\
document.addEventListener('copy',allowContent,false);\
document.addEventListener('keydown',allowContent,false);\
document.removeEventListener('selectstart',blockContent,false);\
document.removeEventListener('dragstart',blockContent,false);\
document.removeEventListener('contextmenu',blockContent,false);\
document.removeEventListener('copy',blockContent,false);\
document.removeEventListener('keydown',blockContent,false);\
}\
else if(document.attachEvent){\
document.attachEvent('onselectstart',allowContent);\
document.attachEvent('ondragstart',allowContent);\
document.attachEvent('oncontextmenu',allowContent);\
document.attachEvent('oncopy',allowContent);\
document.attachEvent('onkeydown',allowContent);\
document.detachEvent('onselectstart',blockContent);\
document.detachEvent('ondragstart',blockContent);\
document.detachEvent('oncontextmenu',blockContent);\
document.detachEvent('oncopy',blockContent);\
document.detachEvent('onkeydown',blockContent);\
}\
}\
if(document.getElementById('_photo_')){\
if(document.addEventListener){\
document.addEventListener('selectstart',allowContent);\
document.addEventListener('dragstart',allowContent);\
document.addEventListener('contextmenu',allowContent);\
document.addEventListener('onkeydown',allowContent);\
}\
else if(document.attachEvent){\
document.attachEvent('onselectstart',allowContent);\
document.attachEvent('ondragstart',allowContent);\
document.attachEvent('oncontextmenu',allowContent);\
document.attachEvent('onkeydown',allowContent);\
}\
document.onkeydown=null;\
};\
document.onselectstart=null;\
document.ondragstart=null;\
document.oncontextmenu=null;\
})()";
intervalText=intervalText.replace(/\t/g,"");
//For Any Browser(without Chrome)
setTimeout(intervalText,0);
var intervalID=setInterval(intervalText,500);
setTimeout("clearInterval("+intervalID+");",3000);
//For Chrome
intervalText='(function())();';
var preset=unsafeWindow.document.body.getAttribute("onmousemove");
unsafeWindow.document.body.setAttribute("preset_enabler",preset);
preset=(preset==null)?'':preset;
unsafeWindow.document.body.setAttribute("onmousemove",preset+";"+intervalText);
}
//Cyworld Blog
else if(/web[0-9]*\.c[0-9]*\.cyworld\.com/i.test(domain)){
if(unsafeWindow.document.body.onload!=null){
var load=String(unsafeWindow.document.body.onload);
load=load.replace('rightClickYn()','');
unsafeWindow.document.body.onload=load;
}
var intervalText="\
if(document.onselectstart!=null)\
if(document.oncontextmenu!=null)\
if(document.ondragstart!=null)\
if(document.body.onmouseup!=null)\
if(document.body.onmouseenter!=null)\
if(document.onmousemove!=null)\
if(document.onmousedown!=null)\
";
intervalText=intervalText.replace(/\t/g,"");
//For Any Browser(without Chrome)
setTimeout(intervalText,0);
var intervalID=setInterval(intervalText,500);
setTimeout("clearInterval("+intervalID+");",3000);
//For Chrome
intervalText='(function())();';
var preset=unsafeWindow.document.body.getAttribute("onmousemove");
unsafeWindow.document.body.setAttribute("preset_enabler",preset);
preset=(preset==null)?'':preset;
unsafeWindow.document.body.setAttribute("onmousemove",preset+";"+intervalText);
}
//Typical enabler(Limited. Don't cause website's malfunction.)
else{
var intervalText="(function(){\
function isOnly_return_false(fnc){\
if(!fnc)\
var fnc=String(fnc);\
fnc=fnc.replace(/[;{}\\n\\r\\t\\v\\f\\0]/g,'');\
fnc=fnc.replace(/function[(a-z)(0-9)_ ]*\\([(a-z)(0-9)_, ]*\\)/ig,'');\
fnc=fnc.replace(/ /g,'');\
fnc=fnc.replace(/" + '"' + "([^" + '"' + "]*)" + '"' + "/g,'');\
fnc=fnc.replace(/'([^']*)'/g,'');\
fnc=fnc.replace(/\\(.*\\)/g,'');\
return (fnc=='returnfalse'||fnc=='window.alertreturnfalse'||fnc=='ifreturnfalse');\
}\
\
if(/none/i.test(document.body.style.MozUserSelect))\
if(/none/i.test(document.body.style.WebkitUserSelect))\
if(/none/i.test(document.body.style.KhtmlUserSelect))\
if(/none/i.test(document.body.style.userSelect))\
\
if(isOnly_return_false(document.oncontextmenu))\
if(isOnly_return_false(document.body.oncontextmenu))\
if(isOnly_return_false(document.body.getAttribute('oncontextmenu')))\
\
if(isOnly_return_false(document.onselectstart))\
if(isOnly_return_false(document.body.onselectstart))\
if(isOnly_return_false(document.body.getAttribute('onselectstart')))\
\
if(isOnly_return_false(document.ondragstart))\
if(isOnly_return_false(document.body.ondragstart))\
if(isOnly_return_false(document.body.getAttribute('ondragstart')))\
\
if(isOnly_return_false(document.onmousedown))\
if(isOnly_return_false(document.body.onmousedown))\
if(isOnly_return_false(document.body.getAttribute('onmousedown')))\
\
if(isOnly_return_false(document.oncopy))\
if(isOnly_return_false(document.body.oncopy))\
if(isOnly_return_false(document.body.getAttribute('oncopy')))\
})()";
intervalText=intervalText.replace(/\t/g,"");
//For Any Browser
setTimeout(intervalText,0);
var intervalID=setInterval(intervalText,500);
setTimeout("clearInterval("+intervalID+");",3000);
}
//Filtered after by "Typical enabler"
//Paran Blog
if(/blog\.paran\.com/i.test(domain)){
unsafeWindow.document.onmousedown=null;
}
//Naver Comic
else if(/comic\.naver\.com/i.test(domain)){
var isOnly_return_false=function(fnc){
if(!fnc)
var fnc=String(fnc);
fnc=fnc.replace(/[;{}\n\r\t\v\f\0]/g,'');
fnc=fnc.replace(/function[(a-z)(0-9)_ ]*\([(a-z)(0-9)_, ]*\)/ig,'');
fnc=fnc.replace(/ /g,'');
fnc=fnc.replace(/" + '"' + "([^" + '"' + "]*)" + '"' + "/g,'');
fnc=fnc.replace(/'([^']*)'/g,'');
fnc=fnc.replace(/\(.*\)/g,'');
return (fnc=='returnfalse'||fnc=='window.alertreturnfalse');
}
var imgs=unsafeWindow.document.getElementsByTagName("img");
var e;
for(var i=0;i<imgs.length;i++){
try}catch(e){}
try}catch(e){}
try}catch(e){}
}
}
})();
//===============
//참고
RightToClick - 현재 다운로드 안됨
'Tips' 카테고리의 다른 글
Windows 시작 종료시 자동 실행 스크립트 사용 방법 (0) | 2017.05.05 |
---|---|
PowerShell 사용법 (0) | 2017.05.05 |
윈도우 명령어 (0) | 2017.03.08 |
중복 파일 삭제 유틸 비교 (1) | 2017.02.24 |
어도비 에러 해결 방법 ( Configuration error, Application Manager ) (5) | 2017.02.22 |