-
본문으로 바로가기

신문기사들을 보다보면 온갖 성인광고들이 화면을 도배하며,

기사를 보라는 건지 광고를 보라는 건지 도무지 이해할 수 없는 상황이 생기다 보니

저도 ADGUARD 라는 애드블록 확장기능을 파이어폭스에 적용하여 사용하고 있습니다.

 

그런 경우를 제외하고 저희 같이 일반 콘텐츠를 작성하여 포스팅하는 사람들에게

광고를 차단하는건 포스팅의 재미를 반으로 줄여 버립니다.

 

adguard 같은 애드블록 확장기능 설치하여 사용하시고, 이런 컨텐츠 보실때는 차단을 잠시 비활성화 해주시기 부탁드립니다.


티스토리, Adguard (애드블록) 차단 스크립트 적용 방법

  ① 애드블록 차단 스크립트 다운로드

  ② 애드블록 차단 스크립트 수정

  ③ 애드블록 차단 스크립트 위치에 이미지 생성

  ④ 티스토리 관리자 스킨변경 페이지로 이동

  ⑤ 티스토리 HTML 편집하여 차단 스크립트 적용하기


1. 애드블록 차단 스크립트 다운로드

① txt 파일을 다운로드 받거나 아래 코드 블록 내용 복사

애드블록 차단 소스(1).txt
0.01MB

<style>
    #h237 {
        position: fixed !important;
        position: absolute;
        top: 0;
        top: expression((t=document.documentElement.scrollTop?document.documentElement.scrollTop: document.body.scrollTop)+"px");
        left: 0;
        width: 102%;
        height: 102%;
        background-color: #f9f9f9;
        opacity: .97;
        display: block;
        padding: 10% 0
    }
    
    #h237 * {
        text-align: center;
        margin: 0 auto;
        display: block;
        filter: none;
        font: bold 14px Verdana, Arial, sans-serif;
        text-decoration: none
    }
    
    #h237 ~ * {
        display: none
    }
</style>
<div id="h237">
    <span>자바스크립트를 허용해주세요.
     <br /><a href="http://www.enable-javascript.com/">[ 자바스크립트 활성화 방법 ]</a>
     <br />from Mohon Aktifkan Javascript!
    </span></div>
<script>
    window.document.getElementById("h237").parentNode.removeChild(window.document.getElementById("h237"));
    (function(l, m) {
        function n(a) {
            a && h237.nextFunction()
        }
        var h = l.document,
            p = ["i", "s", "u"];
        n.prototype = {
            rand: function(a) {
                return Math.floor(Math.random() * a)
            },
            getElementBy: function(a, b) {
                return a ? h.getElementById(a) : h.getElementsByTagName(b)
            },
            getStyle: function(a) {
                var b = h.defaultView;
                return b && b.getComputedStyle ? b.getComputedStyle(a, null) : a.currentStyle
            },
            deferExecution: function(a) {
                setTimeout(a, 250)
            },
            insert: function(a, b) {
                var e = h.createElement("span"),
                    d = h.body,
                    c = d.childNodes.length,
                    g = d.style,
                    f = 0,
                    k = 0;
                if ("h237" == b) {
                    e.setAttribute("id", b);
                    g.margin = g.padding = 0;
                    g.height = "100%";
                    for (c = this.rand(c); f < c; f++) 1 == d.childNodes[f].nodeType && (k = Math.max(k, parseFloat(this.getStyle(d.childNodes[f]).zIndex) || 0));
                    k && (e.style.zIndex = k + 1);
                    c++
                }
                e.innerHTML = a;
                d.insertBefore(e, d.childNodes[c - 1])
            },
            displayMessage: function(a) {
                var b = this;
                a = "abisuq".charAt(b.rand(5));
                b.insert("<" + a + '><img src="https://tistory4.daumcdn.net/tistory/3313580/skin/images/noadimg.png" height="600" width="600" alt="Stop-AdBlock" /> <a href="JavaScript:window.location.reload()">[ Reload ]</a>' + ("</" + a + ">"), "h237");
                h.addEventListener && b.deferExecution(function() {
                    b.getElementBy("h237").addEventListener("DOMNodeRemoved", function() {
                        b.displayMessage()
                    }, !1)
                })
            },
            i: function() {
                for (var a = "DivTopAd,ad-zone-1,ad_190x90,ads-sticky,iqadtile5,leftframeAD,tobsideAd,ad,ads,adsense".split(","), b = a.length, e = "", d = this, c = 0, g = "abisuq".charAt(d.rand(5)); c < b; c++) d.getElementBy(a[c]) || (e += "<" + g + ' id="' + a[c] + '"></' + g + ">");
                d.insert(e);
                d.deferExecution(function() {
                    for (c = 0; c < b; c++)
                        if (null == d.getElementBy(a[c]).offsetParent || "none" == d.getStyle(d.getElementBy(a[c])).display) return d.displayMessage("#" + a[c] + "(" + c + ")");
                    d.nextFunction()
                })
            },
            s: function() {
                var a = {
                        'pagead2.googlesyndic': 'google_ad_client',
                        'js.adscale.de/getads': 'adscale_slot_id',
                        'get.mirando.de/miran': 'adPlaceId'
                    },
                    b = this,
                    e = b.getElementBy(0, "script"),
                    d = e.length - 1,
                    c, g, f, k;
                h.write = null;
                for (h.writeln = null; 0 <= d; --d)
                    if (c = e[d].src.substr(7, 20), a[c] !== m) {
                        f = h.createElement("script");
                        f.type = "text/javascript";
                        f.src = e[d].src;
                        g = a[c];
                        l[g] = m;
                        f.onload = f.onreadystatechange = function() {
                            k = this;
                            l[g] !== m || k.readyState && "loaded" !== k.readyState && "complete" !== k.readyState || (l[g] = f.onload = f.onreadystatechange = null, e[0].parentNode.removeChild(f))
                        };
                        e[0].parentNode.insertBefore(f, e[0]);
                        b.deferExecution(function() {
                            if (l[g] === m) return b.displayMessage(f.src);
                            b.nextFunction()
                        });
                        return
                    }
                b.nextFunction()
            },
            u: function() {
                var a = "ad&adv_keywords=,-page-peel/,/adchain.,/adfootright.,/adsxml/ad,/adyard300.,/impopup/ad,/loadadsparam.,/meme_ad.,_adshare.".split(","),
                    b = this,
                    e = b.getElementBy(0, "img"),
                    d, c;
                e[0] !== m && e[0].src !== m && (d = new Image, d.onload = function() {
                    c = this;
                    c.onload = null;
                    c.onerror = function() {
                        p = null;
                        b.displayMessage(c.src)
                    };
                    c.src = e[0].src + "#" + a.join("")
                }, d.src = e[0].src);
                b.deferExecution(function() {
                    b.nextFunction()
                })
            },
            nextFunction: function() {
                var a = p[0];
                a !== m && (p.shift(), this[a]())
            }
        };
        l.h237 = h237 = new n;
        h.addEventListener ? l.addEventListener("load", n, !1) : l.attachEvent("onload", n)
    })(window);
</script>

2. 애드블록 차단 스크립트 수정

① 다운받은 스크립트에서 b.insert() 내의 내용을 수정합니다.

수정부분: img src="           " 칠해진 영역의 이미지 수정,  height="600" width="600" 삭제

b.insert("<" + a + '><img src="https://tistory4.daumcdn.net/tistory/3313580/skin/images/noadimg.png" height="600" width="600" alt="Stop-AdBlock" /> <a href="JavaScript:window.location.reload()">[ Reload ]</a>' + ("</" + a + ">"), "h237");

수정 후:

b.insert("<" + a + '><img src="https://tistory4.daumcdn.net/tistory/3313580/skin/images/noadimg.png" alt="Stop-AdBlock" /> <a href="JavaScript:window.location.reload()">[ Reload ]</a>' + ("</" + a + ">"), "h237");

3. 애드블록 차단 스크립트 위치에 이미지 생성

① 이미지를 생성하였으면 이미지를 업로드(업로드 파일은 무조건 ./images/ 폴더에 등록되므로 폴더명 필요 없음)

    이미지명이 adblockout.png 라고 하면 아래와 같이 소스파일을 수정하면 됩니다.

    전 급한데로 좀전에 타 사이트에서 가져다 넣어서 변경되는 부분만 확인해 보았습니다.

b.insert("<" + a + '><img src="./images/noadimg.png" alt="AdBlock ㅜㅜ" /> <a href="JavaScript:window.location.reload()">[ Reload ]</a>' + ("</" + a + ">"), "h237");

4. 티스토리 관리자 스킨변경 페이지로 이동

① 관리자 페이지 좌측 꾸미기 > 스킨 편집 클릭

② 우측 HTML 편집 클릭


5. 티스토리 HTML 편집하여 차단 스크립트 적용하기

① 소스를 모두 복사한다

② <s_t3> 과 <div class=...> 사이인 47 줄에 ①의 내용을 붙여 넣기 한다.

 

6. 적용 결과

 


이상입니다.

퍼가기 하실때는 출처 꼭 같이 남겨주시면 감사하겠습니다.


출처: 코키티비, http://cocatv.tistory.com/31

반응형