본문 바로가기
기타

티스토리 우클릭 금지 설정하는 법

by dev_gyu 2024. 12. 17.
728x90

티스토리 블로그를 운영할 때 다른 사람이 글을 복사하는것을 원치 않는 경우가 있을 것이다.

이런 경우 다음과 같은 방법을 사용하면 다른 사람이 글을 복사하지 못하게 막을 수 있다.

 

 

 

우선 블로그 관리 -> 꾸미기 -> 스킨 편집에 들어간다.

 

 

다음으로 스킨 편집 -> html 편집을 눌러준다.

 

 

마지막으로 우클릭 금지 스크립트를 추가해준다.

아래 코드를 복사해서 넣어주면 된다.

 

  <!--우클릭 금지 시작-->
	<script type="text/javascript">
		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
		}
	</script>
  <!--우클릭 금지 종료-->

 


 

위의 방법뿐만이 아닌 간단히 티스토리 Plugin 을 사용하여 우클릭 방지를 추가하여 사용할 수도 있다.

728x90