MasterKia / PersianBlocker

سرانجام، یک لیست بهینه و گسترده برای مسدودسازی تبلیغ ها و ردیاب ها در سایت های پارسی زبان!
GNU Affero General Public License v3.0
328 stars 21 forks source link

فارسروید - اسکریپت تشخیص مسدودساز تبلیغات #244

Closed prouser790 closed 1 month ago

prouser790 commented 1 month ago

درود

روشی برای دور زدن اسکریپت تشخیص مسدود کننده تبلیغات در firefox-ublock origin برای سایت فارسروید هست؟ فارسروید با وردپرس پیاده سازی شده به احتمال زیاد از افزونه مسدود ساز مخصوص ورد پرس استفاده میکنه کدنویسی سایت توسط https://www.dornaweb.com این اطلاعاتو از همین کد زیر در آوردم که یک قسمتش پیغام میده افزونه رو غیرفعال کنید

https://www.farsroid.com/wp-content/cache/autoptimize/js/autoptimize.js

var btndl=$("#btndl");btndl.addClass("download-link-csm-below labeled-dw-ads");var href=btndl.attr("data-target");var en_title=btndl.data("en_title")+".apk";var download_attr=href.includes(".apk")?'download="'+en_title+'"':'';var html='<a href="'+href+'" class="gtm-farsroid-ads farsroid-ads btnDownload" '+download_attr+'>دانلود'+'ADS';btndl.html(html);btndl.css({"border":"1px solid #e8e8e8","padding":"19px","text-align":"center","margin-bottom":"30px"});},set_likedislike_event:function(){$("body").on('click',"[data-dwlikes]",function(e){e.preventDefault();var $btn=$(this);var item=$(this);$.ajax({url:window.apiurl+'counter/',type:"POST",data:{action:'dwlikesdislikes',id:item.data('id'),type:item.data('type'),where:item.data('where')},success:function success(response){if(response.status){item.find('.count').html(response.data.count);} if(response.data.unvote){$btn.removeClass('voted');}else{$btn.addClass('voted');} dwtoast(response.data.message,false,response.status&&!response.data.unvote?'green':'red');},error:function error(e){console.log(e.responseText);}});});},set_load_more_comments_event:function(){$('body').on('click','#next_comments_link a',function(e) {e.preventDefault();debugger;var button=$(this).parent();var post_id=button.data("post_id");var page=button.data("page");if(page>1) {page=page-1;} else if(page==-1) {page=page;} else{return false;} var data={action:"ma_comment_pagination",post_id:post_id,page:page};ma_custom.send_data(data,function(resp) {var last_comments=$('#comments_list > .comment:last-child');$('#comments_list').append(resp.html);$("html, body").stop().animate({scrollTop:last_comments.offset().top+last_comments.outerHeight(true)-10},500,'swing');if(resp.end==true) {button.remove();} else {button.data("page",page);}},null,this)});},set_load_more_reviews_event:function(){$('body').on('click','.load-more-reviews',function(e) {e.preventDefault();var button=$(this);var post_id=button.data("post_id");var page=button.data("page");var page_count=button.data("page_count");if(page<page_count) {page++;} else{return false;} var data={action:"ma_review_pagination",post_id:post_id,page:page};ma_custom.send_data(data,function(resp) {$('#reviews_list_ul').append(resp.html);button.removeClass('loading');if(resp.end==true) {button.remove();} else {button.data("page",page);}},null,this)});},},anti:{run:function(){var body=$("body");if(body.hasClass("home")) {this.home_page();} else if(body.hasClass("archive")&&body.hasClass("category")) {this.archive();} else if(body.hasClass("single-post")) {this.single_post();}},home_page:function() {if(this.check_hidden_element(".site-middle-banners")){this.remove_page_content();} else{console.log("ad blocker is not active");}},archive:function() {if(this.check_hidden_element(".site-middle-banners")){this.remove_page_content();} else{console.log("ad blocker is not active");}},single_post:function() {if(this.check_hidden_element(".site-middle-banners")||this.check_hidden_element("#btndl")){this.remove_page_content();} else{console.log("ad blocker is not active");}},check_hidden_element:function(selector){selector=$(selector);if(selector.length==0){return false;} if(selector.css("display")=="none"||selector.css("visibility")=="hidden"||selector.css("opacity")==0||selector.css("max-height")=="1px"||selector.css("pointer-events")=="none"||selector.offset().top=="none") {return true;} var detect=false;selector.find("").each(function() {var child=$(this);if(child.css("display")=="none"||child.css("visibility")=="hidden"||child.css("opacity")==0||child.css("max-height")=="1px"||child.css("pointer-events")=="none") {detect=true;return false;}});return detect;},remove_page_content:function(){var html="

"+"

کاربر عزیز، برای استفاده رایگان از امکانات وب‌سایت فارسروید افزونه حذف تبلیغات [ادبلاکر-مسدودساز تبلیغ] را در مرورگر اینترنت‌تان غیرفعال کرده و سپس صفحه را مجددا بارگذاری کنید :)

"+"
"+"";$(".primary-area").html(html);$("#site_wrap").html(html);console.log("ad blocker is active");},is_hide:function(){var el=null;$(".site-middle-banners").each(function(i,banner) {var next_el=$(banner).next();if(next_el.length===1){el=$(banner);return false;}});if(el==null) {return false;} /!

MasterKia commented 1 month ago

https://github.com/uBlockOrigin/uAssets/issues/24849#issuecomment-2278413868

لیست uBOPa رو غیرفعال کنید درست میشه.

prouser790 commented 1 month ago

غیر فعال کردم درست نشد اون قسمتی هم که گفتید به مای فیلتر اضافه کردم نشد farsroid.com#@#[class="-ads "] farsroid.com#@#*[class$="-ads"]

prouser790 commented 1 month ago

مشکل از تداخل با لیست ادبلاک بود حذف کردم درست شد

باتشکر