Skip to content

Instantly share code, notes, and snippets.

@amblerkr
Last active October 8, 2022 01:47
Show Gist options
  • Select an option

  • Save amblerkr/7f065339f87563c9d4afcfd456760b0a to your computer and use it in GitHub Desktop.

Select an option

Save amblerkr/7f065339f87563c9d4afcfd456760b0a to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Anti-Disabler for Naver
// @namespace https://userscripts-mirror.org/users/dyhan81
// @description The script allows users to call the context menu or select the texts in Naver, and when you copy text, script will get rid of a annoying source indication.
// @include http://blog.naver.com/*
// @include http://cafe.naver.com/*
// @copyright 2009+, Dong-yoon Han (http://cb-dyhan81.blogspot.com)
// @license (CC) Attribution Non-Commercial Share Alike; http://creativecommons.org/licenses/by-nc-sa/2.0/kr/
// @version 1258306524556; Mon Nov 16 2009 02:35:24 GMT+0900
// @injectframes 1
// ==/UserScript==
(function(){
var intervalID;
var domain = window.location.host;
// For Blog
if (domain.toLowerCase().indexOf("blog.")>-1)
{
intervalID = setInterval(" \
if(window.AutoSourcing != null) \
{ \
AutoSourcing.setEnable(false); \
} \
\
if(window.utility != null) \
{ \
utility.detachSelectPrevent(); \
} \
", 500);
setTimeout("clearInterval("+intervalID+");", 3000);
}
/* For Cafe */
if (domain.toLowerCase().indexOf("cafe.")>-1)
{
intervalID = setInterval(" \
if(window.AutoSourcing != null) \
AutoSourcing.setEnable(false); \
\
var alternativeCancelBlockMouseRight = function(theElement) \
{ \
var trueFunc = function() \
{ \
return true; \
}; \
\
theElement.oncontextmenu = trueFunc; \
theElement.onselectstart = trueFunc; \
theElement.ondragstart = trueFunc; \
}; \
\
if(window.CancelBlockMouseRight != null) \
{ \
CancelBlockMouseRight(); \
cancelBlockDragInFF(); \
} \
\
if(window.mlayoutPhoto != null) \
{ \
alternativeCancelBlockMouseRight(parent.document); \
alternativeCancelBlockMouseRight(window.mlayoutPhoto.oView); \
window.mlayoutPhoto.opt.allowRightMouseClick = true; \
} \
",500);
setTimeout("clearInterval("+intervalID+");", 3000);
intervalID = setInterval(" \
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; \
} \
", 500);
setTimeout("clearInterval("+intervalID+");", 3000);
}
})();
javascript: function naver(q){ void(z=q.body.appendChild(q.createElement('script'))); void(z.language='javascript'); void(z.type='text/javascript'); void(z.src='https://greasyfork.org/scripts/23772-absolute-enable-right-click-copy/code/Absolute%20Enable%20Right%20Click%20%20Copy.user.js');} function selfw(w) { try{naver(w.document);} catch(e){} for (var i =0; i <w.frames.length; i++) { try{ selfw(w.frames[i]); } catch(e){} } } selfw(self);(function() { var e, i, all; document.onselectstart = null; document.oncontextmenu = null; all = document.getElementsByTagName("*"); for (i = 0; i < all.length; i += 1) { e = all[i]; e.onselectstart = null; e.oncontextmenu = null; } })();
javascript:{function unify(d){try{d.oncontextmenu = null;d.onselectstart = null;d.ondragstart = null;d.onkeydown = null;d.onmousedown = null;d.body.oncontextmenu = null;d.body.onselectstart = null;d.body.ondragstart = null;d.body.onkeydown = null;d.body.onmousedown = null;}catch(e){};if (d.frames.length > 0) {for (var i = 0; i < d.frames.length; i++) {try {unify(d.frames[i]);} catch (e) {}};};for(i in document.getElementsByTagName("div")){try{unify(document.getElementsByTagName("div")[i]);}catch(e) {};}}unify(self);var domain = document.URL;if (domain.toLowerCase().indexOf('blog.') > -1) {document.getElementById('mainFrame').contentDocument.getElementById('photoviewer').draggable = true;document.getElementById('mainFrame').contentDocument.papermain.utility.detachSelectPrevent();}if (domain.toLowerCase().indexOf('cafe.') > -1) {document.getElementById('cafe_main').contentDocument.oncontextmenu = null;document.getElementById('cafe_main').contentDocument.ondragstart = null;document.getElementById('cafe_main').contentDocument.onselectstart = null;document.getElementById('cafe_main').contentDocument.photoViewerFrm.draggable = true;}alert('해제되었습니다.');}
@amblerkr
Copy link
Copy Markdown
Author

amblerkr commented Dec 12, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment