Page 1 of 1

How to bypass Xenforums rellect (ad block detection)

PostPosted: Sat Jan 14, 2017 4:09 pm
by kjstech
Does anyone know how to bypass Xenforums plugin rellect to stop the annoying adblocking detected message on any site running this plugin on xenforums software?

Plugin info here:
Code: Select all
https://xenforo.com/community/resources/rellect-adblock-detector.2312/


Here's a snippit of code:
Code: Select all
XenForo.rellect = XenForo.rellect || {};

XenForo.rellect.AdBlockDetectorParams = {
   expiry: 1800,
   hours: 30,
   canDismiss: 1,
   type: "overlay",
   phrases: {
      title: "Your attention is required",
      message: "Aw Snap! Our system sees that an \"AdBlocker\" is installed in your browser. This makes us sad as any visitor here can help to support this site by allowing the ads to display. Please be so kind to help support this site by whitelisting us in your AdBlocker.  Which of course will also stop this annoying message and make us happy again. :) ",
      close: "Close"
   },
   loadScript: function(url, loadFn, errorFn){
      var script = $('<script />', {
         async: 'async',
         src: url
      })
      .load(function(){
         if(loadFn){
            loadFn();
            loadFn = null;
         }
      })
      .error(function(jqXHR, textStatus){
         /* When script is blocked, textStatus is undefined. */
         if(typeof textStatus !== 'undefined'){
            return;
         }

         if(errorFn){
            errorFn(jqXHR, textStatus);
            errorFn = null;
         }
      });

      (document.body || document.getElementsByTagName('body')[0]).appendChild(script[0]);
   }
};

var AdBlockDetectorWorkaround = function(){
   /* This is just in case the handler script is blocked by the adblocker */
   if(!XenForo.rellect.AdBlockDetector){
      console.log('AdBlock detector failed. Trying workaround.');
      XenForo.ajax('index.php', {dataType: 'html', AdblockDetector: 1}, function(ajaxData){
         if(XenForo.hasTemplateHtml(ajaxData)){
            try{
               jQuery.globalEval(ajaxData.templateHtml);
            }
            catch(e){}
         }
      }, {
         error: function(){
            console.log('AdBlock detector workaround failed.');
         }
      });
   }
};

XenForo.rellect.AdBlockDetectorParams.loadScript(
   'js/rellect/AdblockDetector/handler.min.js?rev=34',
   false,
   AdBlockDetectorWorkaround
);


Contents of handler.min.js
Code: Select all
/**
* www.rellect.com
*/
XenForo.rellect=XenForo.rellect||{};
!function(a,h,n,p){XenForo.rellect.AdBlockDetector={start:function(){$AdBlockDetector=this;if(XenForo.rellect.AdBlockDetectorParams!==p&&h.self==h.top&&!$AdBlockDetector.isBot()){if(a('link[href*="admuncher.com"]').length)return $AdBlockDetector.triggerError();$AdBlockDetector.prepareBait();var c=$AdBlockDetector.scriptLoad,f=$AdBlockDetector.scriptError,b="undefined"!=$AdBlockDetector.cssAd.css("-moz-binding");if(!b&&$AdBlockDetector.isCssBlocked())f();else if($AdBlockDetector.isVarBlocked())XenForo.rellect.AdBlockDetectorParams.loadScript("//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",c,
f);else if(b||-1<navigator.userAgent.indexOf("MSIE ")||-1<navigator.userAgent.indexOf("Trident/")){var g=0;(function d(){setTimeout(function(){$AdBlockDetector.isCssBlocked()?f():4>g?(g++,d()):$AdBlockDetector.cssAd.remove()},2E3)})()}}},scriptError:function(a,f){console.log("AdBlock detector: show alert.");$AdBlockDetector.triggerError()},scriptLoad:function(){$AdBlockDetector.isVarBlocked()&&(console.log("AdBlock detector: var verification failed on load event."),$AdBlockDetector.triggerError())},
isBot:function(){return/bot|crawler|spider|archive|baid|bing|facebook|google|proximic|scoutjet|yahoo|yandex/i.test(navigator.userAgent)},isVarBlocked:function(){return h.adsbygoogle&&h.adsbygoogle.hasOwnProperty("push")?!1:!0},prepareBait:function(){$AdBlockDetector.cssAd=$AdBlockDetector.cssAd||a('<ins class="adsbygoogle" style="display: block; position: absolute; font-size: 1px; width: 1px; height: 1px; overflow: hidden;">&nbsp;</ins>').css(XenForo.isRTL()?"right":"left","-999px").appendTo("body");
return $AdBlockDetector.cssAd},isCssBlocked:function(){$AdBlockDetector.cssAd=$AdBlockDetector.cssAd||$AdBlockDetector.prepareBait();return $AdBlockDetector.cssAd.is(":hidden")?(console.log("AdBlock detector: css test failed."),$AdBlockDetector.cssAd.remove(),!0):!1},triggerEvent:function(c){a(n).triggerHandler(c);a("."+c).show()},triggerError:function(){"none"!=XenForo.rellect.AdBlockDetectorParams.type&&$AdBlockDetector.showAlert(XenForo.rellect.AdBlockDetectorParams.type);$AdBlockDetector.triggerEvent("AdBlockOn")},
setCookie:function(){var c=new Date;c.setTime(c.getTime()+1E3*XenForo.rellect.AdBlockDetectorParams.expiry);a.setCookie("adblock_alert",XenForo.rellect.AdBlockDetectorParams.hours,c)},dismissed:function(){-1!=XenForo.rellect.AdBlockDetectorParams.hours&&$AdBlockDetector.setCookie()},getAlertTypes:function(){return["overlay","float","notice","notification"]},showAlert:function(c){var f=String(XenForo.rellect.AdBlockDetectorParams.phrases.title||"Missing phrase"),b=String(XenForo.rellect.AdBlockDetectorParams.phrases.message||
"Missing phrase"),g=String(XenForo.rellect.AdBlockDetectorParams.phrases.close||"Missing phrase");switch(c){case "overlay":c=XenForo.alert(b,f);b=b.replace(/[^a-z0-9_]/gi,"_")+parseInt(!1);XenForo.rellect.AdBlockDetectorParams.canDismiss||c.find(".close").remove();a(XenForo._OverlayCache[b]).bind("onBeforeClose",function(){if(!XenForo.rellect.AdBlockDetectorParams.canDismiss)return!1;$AdBlockDetector.dismissed()});break;case "float":var e=a('<div class="adblock_detector adblock_floating_message" style="display:none"><div class="errorDetails"><div class="alertIcon"></div><a class="close" title="'+
g+'">&times;</a><div class="errorMessage">'+b+"</div></div></div>"),d=e.appendTo("body"),l=d.height(),b=d.find(".close"),m=a("html");XenForo.isTouchBrowser()&&e.css("position","absolute");XenForo.rellect.AdBlockDetectorParams.canDismiss?(d.xfActivate(),b.click(function(){d.slideUp(XenForo.speed.fast);m.animate({paddingTop:0},XenForo.speed.fast);$AdBlockDetector.dismissed()})):b.remove();m.animate({paddingTop:l},{duration:XenForo.speed.fast,queue:!1});d.slideDown({duration:XenForo.speed.fast,queue:!1});
a(h).bind("resize orientationchange",function(){l!=d.height()&&(l=d.height(),m.css("padding-top",l))});break;case "notice":e=a('<div class="adblock_detector adblock_notice" style="display:none"><div class="errorDetails"><div class="alertIcon"></div><a class="close" title="'+g+'">&times;</a><div class="errorMessage">'+b+"</div></div></div>");d=0<a(".breadBoxTop").length?e.insertAfter(".breadBoxTop:first"):0<a(".mainContent").length?e.prependTo(".mainContent"):e.insertAfter(".titleBar:first");XenForo.rellect.AdBlockDetectorParams.canDismiss||
e.find(".close").remove();d.xfFadeDown(XenForo.speed.fast,function(){XenForo.rellect.AdBlockDetectorParams.canDismiss&&a(this).find(".close").click(function(){d.xfFadeUp(XenForo.speed.fast,function(){$AdBlockDetector.dismissed()})})});break;case "notification":var e=a('<li class="adblock_detector adblock_notification DismissParent" style="display:none"><div class="adblock_notification_content"><a class="close" title="'+g+'">&times;</a>'+b+"</div></li>"),k=a("#StackAlerts"),b=e.find(".close");k.length||
(k=a('<ul id="StackAlerts"></ul>').appendTo("body"));e.prependTo(k.show()).fadeIn(XenForo.speed.normal);XenForo.rellect.AdBlockDetectorParams.canDismiss?(e.xfActivate(),b.click(function(){e.xfFadeUp(XenForo.speed.slow,function(){a(this).empty().remove();k.children().length||k.hide();$AdBlockDetector.dismissed()})})):b.remove();break;case "random":b=$AdBlockDetector.getAlertTypes(),$AdBlockDetector.showAlert(b[Math.floor(Math.random()*b.length)])}}};a(function(){XenForo.rellect.AdBlockDetector.start()})}(jQuery,
this,document);

Re: How to bypass Xenforums rellect (ad block detection)

PostPosted: Sat Jan 14, 2017 4:17 pm
by mapx
going to - for example -
Code: Select all
https://xenforo.com/community/threads/is-there-an-official-xenforo-support-forum-in-spanish.122959/


I get no detecting stuff. Do I need logging in (do I need an account) ?

browser version ? ABP version ?

Re: How to bypass Xenforums rellect (ad block detection)

PostPosted: Sat Jan 14, 2017 9:18 pm
by smed79
If the site that uses this addon is example.com Try

Code: Select all
@@||example.com^$generichide

Re: How to bypass Xenforums rellect (ad block detection)

PostPosted: Sat Jan 14, 2017 9:34 pm
by mapx
well, if is not used on xenforo sites, just provide an example page.

Re: How to bypass Xenforums rellect (ad block detection)

PostPosted: Wed Apr 19, 2017 2:20 pm
by kjstech