[MAC][AdGuard 2.4.3.718] Facebook Sponsored ads are NOT blocked

Blaz

Moderator & Translator
Staff member
Moderator
Is this new or old layout? On old layout they are blocked, so far the filfter devs did not get the new layout yet.
 

giodeluigi

New Member
Is this new or old layout? On old layout they are blocked, so far the filfter devs did not get the new layout yet.
Hi mate, I think it's the new one, I don't know, I can't see any difference between now and then just that the sponsored ads are back from some day...
I just installed a Chrome extension called "F.B. Purity" which perfectly does the job.
No more sponsored ads in timeline.
Maybe the team could take a look into it and catch some inspiration for AdGuard.
Thank you
 

Blaz

Moderator & Translator
Staff member
Moderator
As long as facebook is not unlocking new interface for our filter maintenancer, sadly not.
 

Blaz

Moderator & Translator
Staff member
Moderator
English UK ist my default language selected. I also tried other ones, but the same.
Are the ads disappearing Ehen you move the mouse on Sponsored text? If yes, javascript is slow sometimes.
 

giodeluigi

New Member
English UK ist my default language selected. I also tried other ones, but the same.
Are the ads disappearing Ehen you move the mouse on Sponsored text? If yes, javascript is slow sometimes.
Have you tried to set American English?
 
Last edited:

Blaz

Moderator & Translator
Staff member
Moderator
Yes, just tried English US and ads are blocked on old interface on my device.
 

Blaz

Moderator & Translator
Staff member
Moderator
Please try this rule for new interface (it should still work on old interface). I only tested it so far on English (UK):
Code:
facebook.com#%#!function(){var e=new MutationObserver(function(){var f=document.querySelectorAll("div[id^='mount_']");if(0<f.length)var e=document.querySelectorAll('div[role="feed"] > div[data-pagelet^="FeedUnit"]');else e=document.querySelectorAll('[id^="substream"] > div:not(.hidden_elem) div[id^="hyperfeed_story_id"]');e.forEach(function(e){function t(e,t){for(s=0<f.length?e.querySelectorAll('div[role="article"] span[dir="auto"] > a > span > span > span[data-content]'):e.querySelectorAll('.userContentWrapper h5 + div[data-testid*="sub"] a [class] [class]'),socheck=0;socheck<s.length;socheck++)s[socheck].innerText.contains(t)&&(c=["1"],d=["1"],i=["1"],r=l=o=1,socheck=s.length)}function n(e,t,n,a,o){i=0<f.length?(s=e.querySelectorAll('div[role="article"] span[dir="auto"] > a > span > span > span[data-content='+t+"]"),c=e.querySelectorAll('div[role="article"] span[dir="auto"] > a > span > span > span[data-content='+n+"]"),d=e.querySelectorAll('div[role="article"] span[dir="auto"] > a > span > span > span[data-content='+a+"]"),e.querySelectorAll('div[role="article"] span[dir="auto"] > a > span > span > span[data-content='+o+"]")):(s=e.querySelectorAll('.userContentWrapper h5 + div[data-testid*="sub"] a [data-content='+t+"]"),c=e.querySelectorAll('.userContentWrapper h5 + div[data-testid*="sub"] a [data-content='+n+"]"),d=e.querySelectorAll('.userContentWrapper h5 + div[data-testid*="sub"] a [data-content='+a+"]"),e.querySelectorAll('.userContentWrapper h5 + div[data-testid*="sub"] a [data-content='+o+"]")),0==s.length&&(s=e.querySelectorAll('.userContentWrapper h5 + div[data-testid*="label"] a [data-content='+t+"]"),c=e.querySelectorAll('.userContentWrapper h5 + div[data-testid*="label"] a [data-content='+n+"]"),d=e.querySelectorAll('.userContentWrapper h5 + div[data-testid*="label"] a [data-content='+a+"]"),i=e.querySelectorAll('.userContentWrapper h5 + div[data-testid*="label"] a [data-content='+o+"]"))}var a=0,o=0,l=0,r=0,s=0,c=0,d=0,i=0,u=e.querySelectorAll("div[style='width: 100%'] > a[href*='oculus.com/quest'] > div");if(h=document.querySelector("[lang]"))var h=document.querySelector("[lang]").lang;else h="en";var p=e.querySelectorAll('a[ajaxify*="ad_id"] > span'),g=e.querySelectorAll('a[href*="ads/about"]');if("display: none !important;"!=e.getAttribute("style")&&!e.classList.contains("hidden_elem")){if(0<p.length||0<g.length){if(m+=1,0<f.length)var y=e.querySelectorAll("a[href]")[1].innerText;else y=e.querySelectorAll("a[href]")[2].innerText;console.log("--------"),console.log("Ad hidden from: "+y),console.log("Total ads hidden: "+m),console.log("F length: "+p.length),console.log("H length: "+g.length),console.log("--------"),e.style="display:none!important;"}else if(0<u.length){m+=1;y="Facebook";console.log("--------"),console.log("Ad hidden from: "+y),console.log("Total ads hidden: "+m),console.log("Non-declared ad"),console.log("--------"),e.style="display:none!important;"}else"af"==h?t(e,"Geborg"):"de"==h||"nl"==h?n(e,"G","e","s","n"):"am"==h?t(e,"የተከፈለበት ማስታወቂያ"):"ar"==h?t(e,"مُموَّل"):"as"==h?t(e,"পৃষ্ঠপোষকতা কৰা"):"az"==h?t(e,"Sponsor dəstəkli"):"co"==h?t(e,"Spunsurizatu"):"bs"==h||"sl"==h||"cs"==h?n(e,"S","p","z","n"):"da"==h||"en"==h||"et"==h||"fy"==h||"it"==h||"ku"==h||"nb"==h||"nn"==h||"pl"==h||"sq"==h||"sv"==h||"zz"==h?0<f.length?(n(e,"S","p","s","n"),t(e,"広告"),t(e,"pəɹosuodS")):document.querySelector("body").className.includes("Locale_en_UD")?t(e,"pəɹosuodS"):document.querySelector("body").className.includes("ja_KS")?t(e,"広告"):n(e,"S","p","s","n"):"be"==h?t(e,"Рэклама"):"bg"==h?t(e,"Спонсорирано"):"mk"==h?t(e,"Спонзорирано"):"br"==h?t(e,"Paeroniet"):"ca"==h?t(e,"Patrocinat"):"gl"==h||"pt"==h?t(e,"Patrocinado"):"bn"==h?t(e,"সৌজন্যে"):"cb"==h?t(e,"پاڵپشتیکراو"):"cx"==h?n(e,"G","i","s","n"):"cy"==h?t(e,"Noddwyd"):"el"==h?t(e,"Χορηγούμενη"):"eo"==h?t(e,"Reklamo"):"es"==h?n(e,"P","u","c","d"):"eu"==h?t(e,"Babestua"):"fa"==h?t(e,"دارای پشتیبانی مالی"):"ff"==h?t(e,"Yoɓanaama"):"fi"==h?t(e,"Sponsoroitu"):"fo"==h?t(e,"Stuðlað"):"fr"==h?0<f.length?(n(e,"S","p","s","n"),n(e,"C","o","m","n")):document.querySelector("body").className.includes("Locale_fr_FR")?n(e,"S","p","s","n"):n(e,"C","o","m","n"):"ga"==h?t(e,"Urraithe"):"gn"==h?t(e,"Oñepatrosinapyre"):"gu"==h?t(e,"પ્રાયોજિત"):"ha"==h?t(e,"Daukar Nauyi"):"he"==h?t(e,"ממומן"):"hr"==h?t(e,"Plaćeni oglas"):"ht"==h?t(e,"Peye"):"ne"==h||"mr"==h||"hi"==h?t(e,"प्रायोजित"):"hu"==h?n(e,"H","i","r","d"):"hy"==h?t(e,"Գովազդային"):"id"==h?n(e,"B","e","p","n"):"is"==h?t(e,"Kostað"):"ja"==h?t(e,"広告"):"ms"==h?t(e,"Ditaja"):"jv"==h?t(e,"Disponsori"):"ka"==h?t(e,"რეკლამა"):"kk"==h?t(e,"Демеушілік көрсеткен"):"km"==h?t(e,"បានឧបត្ថម្ភ"):"kn"==h?t(e,"ಪ್ರಾಯೋಜಿತ"):"ko"==h?t(e,"Sponsored"):"ky"==h?t(e,"Демөөрчүлөнгөн"):"lo"==h?t(e,"ຜູ້ສະໜັບສະໜູນ"):"lt"==h?t(e,"Remiama"):"lv"==h?t(e,"Apmaksāta reklāma"):"mg"==h?t(e,"Misy Mpiantoka"):"ml"==h?t(e,"സ്പോൺസർ ചെയ്തത്"):"mn"==h?t(e,"Ивээн тэтгэсэн"):"mt"==h?t(e,"Sponsorjat"):"my"==h?t(e,"ပံ့ပိုးထားသည်"):"or"==h?t(e,"ପ୍ରଯୋଜିତ"):"pa"==h?t(e,"ਸਰਪ੍ਰਸਤੀ ਪ੍ਰਾਪਤ"):"ps"==h?t(e,"تمويل شوي"):"ro"==h?t(e,"Sponsorizat"):"ru"==h||"uk"==h?t(e,"Реклама"):"rw"==h?t(e,"Icyamamaza ndasukirwaho"):"sc"==h?t(e,"Patronadu de"):"si"==h?t(e,"අනුග්‍රාහක"):"sk"==h?t(e,"Sponzorované"):"sn"==h?t(e,"Zvabhadharirwa"):"so"==h?t(e,"La maalgeliyey"):"sr"==h?t(e,"Спонзорисано"):"sw"==h?t(e,"Imedhaminiwa"):"sy"==h?t(e,"ܒܘܕܩܐ ܡܡܘܘܢܐ"):"sz"==h?t(e,"Szpōnzorowane"):"ta"==h?t(e,"விளம்பரம்"):"te"==h?t(e,"ప్రాయోజితం చేయబడింది"):"tg"==h?t(e,"Бо сарпарастӣ"):"th"==h?t(e,"ได้รับการสนับสนุน"):"tl"==h?t(e,"May Sponsor"):"tr"==h?t(e,"Sponsorlu"):"tt"==h?t(e,"Хәйрияче"):"tz"==h?t(e,"ⵉⴷⵍ"):"ur"==h?t(e,"سپانسرڈ"):"uz"==h?t(e,"Reklama"):"vi"==h?t(e,"Được tài trợ"):"zh-Hans"==h?t(e,"赞助内容"):"zh-Hant"==h&&t(e,"贊助");if(0<s.length&&0<c.length&&0<d.length&&0<i.length){for(cont=0;cont<s.length;cont++)0<s[cont].offsetHeight&&(cont=s.length,a=1);for(cont1=0;cont1<c.length;cont1++)0<c[cont1].offsetHeight&&(cont1=c.length,o=1);for(cont2=0;cont2<d.length;cont2++)0<d[cont2].offsetHeight&&(cont2=d.length,l=1);for(cont3=0;cont3<i.length;cont3++)0<i[cont3].offsetHeight&&(cont3=i.length,r=1);if(1==a&&1==o&&1==l&&1==r){if(0<f.length)y=e.querySelectorAll("a[href]")[1].innerText;else y=e.querySelectorAll("a[href]")[2].innerText;m+=1,console.log("--------"),console.log("Ad hidden from: "+y),console.log("Total ads hidden: "+m),console.log("--------"),e.style="display:none!important;"}}}})}),m=0;e.observe(document,{childList:!0,subtree:!0,characterData:!0,attributes:!0})}();
If not working, I need the selected facebook language.
 
Last edited:

Blaz

Moderator & Translator
Staff member
Moderator
Thanks for testing, I added the rule to Base filter.
 
Top