Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <img src="/ads/" width="0" height="0" border="0" alt="adblocktest" id="adblocktest" onload="this.imgloaded=true;" onerror="this.imgloaded=true;" />
- <script type="text/javascript">
- adblockblock = function() {
- if (window.addEventListener) {
- window.addEventListener('load', this.bind(this.initialize), false);
- } else if (window.attachEvent) {
- window.attachEvent('onload', this.bind(this.initialize));
- }
- };
- adblockblock.prototype = {
- initialize: function() {
- this.interval = setInterval(this.bind(this.test), 1000);
- this.test();
- },
- test: function() {
- var element=document.getElementById('adblocktest');
- /* Maxthon?, Konqueror
- */
- if(!element)
- {
- this.logger('Element image non trouvé');
- return this.block();
- }
- /*
- */
- if (element.complete && !element.imgloaded)
- {
- this.logger('Görüntü yüklenmediyse');
- return this.block();
- }
- /* Eski Adblock
- */
- var display = this.getStyle(element, 'display');
- var visibility = this.getStyle(element, 'visibility');
- var position = this.getStyle(element, 'position');
- if (display != 'inline' || (visibility != 'visible' && visibility != 'inherit') || position != 'static')
- {
- this.logger('Image cachée: display='+display+' visibility='+visibility+' position='+position);
- return this.block();
- }
- /* Adblock ile engellemeyen boy ve yükseklik 0 olmalı
- */
- if ((element.naturalWidth && element.naturalWidth > 0) || (element.naturalHeight && element.naturalHeight > 0)) {
- this.logger('Resim değiştirildi');
- return this.block();
- }
- /* Pour Konqueror
- */
- if (element.width && element.width == 64) {
- this.logger('Resim değiştirildi (Konqueror)');
- return this.block();
- }
- },
- getStyle: function(element, key) {
- if (document.defaultView && document.defaultView.getComputedStyle) {
- return document.defaultView.getComputedStyle(element, '').getPropertyValue(key);
- } else {
- return element.currentStyle[key];
- }
- },
- block: function(blockMethod) {
- // Bu satırı kaldırmayın
- if (this.interval) clearInterval(this.interval);
- // Burada adblockçular ne yapmak istiyorsanız onu
- alert('Bu sitede rahatsız edici reklamlar yoktur.Adblock ayarlarından engeli kaldırın.! ');
- },
- bind: function(func) {
- var obj = this;
- return function() {
- return func.apply(obj, []);
- };
- },
- logger: function(str) {
- if (typeof console == 'undefined') return;
- if (typeof console.log == 'undefined') return;
- console.log(str);
- }
- };
- /* Firebug için debuger
- if (typeof console == 'undefined') {
- console={};
- console.log = function(str) {
- var el = document.createElement('div');
- el.appendChild(document.createTextNode(str));
- document.body.appendChild(el);
- };
- }
- */
- new adblockblock();
- </script>
Advertisement
Add Comment
Please, Sign In to add comment