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

Blaz

Moderator & Translator
Staff member
Moderator
Please try this rule, I added a little fix which should hopefully resolve the issue:
Code:
facebook.com#%#!function(){var e=new MutationObserver(function(){var S=document.querySelectorAll("div[id^='mount_']");if(0<S.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<S.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"],i=["1"],d=["1"],r=l=o=1,socheck=s.length)}function n(e,t,n,a,o){d=0<S.length?(s=e.querySelectorAll('div[role="article"] span[dir="auto"] > a > span span[data-content='+t+"]"),c=e.querySelectorAll('div[role="article"] span[dir="auto"] > a > span span[data-content='+n+"]"),i=e.querySelectorAll('div[role="article"] span[dir="auto"] > a > span span[data-content='+a+"]"),e.querySelectorAll('div[role="article"] span[dir="auto"] > a > 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+"]"),i=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+"]"),i=e.querySelectorAll('.userContentWrapper h5 + div[data-testid*="label"] a [data-content='+a+"]"),d=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,i=0,d=0,u=e.querySelectorAll("div[style='width: 100%'] > a[href*='oculus.com/quest'] > div"),h=document.querySelector("[lang]"),p=document.querySelectorAll("link[rel='preload'][href*='/l/']");if(h)h=document.querySelector("[lang]").lang;else h="en";var g=e.querySelectorAll('a[ajaxify*="ad_id"] > span'),y=e.querySelectorAll('a[href*="ads/about"]');if("display: none !important;"!=e.getAttribute("style")&&!e.classList.contains("hidden_elem")){if(0<g.length||0<y.length){if(m+=1,0<S.length){if(""==(f=e.querySelectorAll("a[href]")[0].innerText))var f=e.querySelectorAll("a[href]")[1].innerText;if(""==f)f=e.querySelectorAll("a[href]")[0].querySelectorAll("a[aria-label]")[0].getAttribute("aria-label")}else f=e.querySelectorAll("a[href]")[2].innerText;console.log("--------"),console.log("Ad hidden from: "+f),console.log("Total ads hidden: "+m),console.log("F length: "+g.length),console.log("H length: "+y.length),console.log("--------"),e.style="display:none!important;"}else if(0<u.length){m+=1;f="Facebook";console.log("--------"),console.log("Ad hidden from: "+f),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<S.length?p[0].href.contains("en_UD")?t(e,"pəɹosuodS"):p[0].href.contains("ja_KS")?t(e,"広告"):n(e,"S","p","s","n"):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<S.length?p[0].href.contains("fr_FR")?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<i.length&&0<d.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<i.length;cont2++)0<i[cont2].offsetHeight&&(cont2=i.length,l=1);for(cont3=0;cont3<d.length;cont3++)0<d[cont3].offsetHeight&&(cont3=d.length,r=1);if(1==a&&1==o&&1==l&&1==r){if(0<S.length)f=e.querySelectorAll("a[href]")[1].innerText;else if(""==f)f=e.querySelectorAll("a[href]")[2].innerText;m+=1,console.log("--------"),console.log("Ad hidden from: "+f),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})}();
 

Blaz

Moderator & Translator
Staff member
Moderator
Can you please save the ad's code from developer tools and send it to me, thank you. It is located in code:

div[role="feed"] > div[data-pagelet^="FeedUnit"]
or
[id^="substream"] > div:not(.hidden_elem) div[id^="hyperfeed_story_id"]
 

giodeluigi

New Member
If I try to block a sponsored ad via AdGuard removing objects tool, I get this code rule:

facebook.com###u_fetchstream_2_18 > div._5pcr.userContentWrapper:last-child > div._1dwg._1w_m._q7o:first-child
 

Blaz

Moderator & Translator
Staff member
Moderator
Made some tweaks to existing rule, now hiding too for a few special cases. According to
giodeluigi 's PM it works for him on old interface (according to code he does not have new interface)

Rule for the curious ones:
Code:
facebook.com,facebookcorewwwi.onion#%#!function(){var e=new MutationObserver(function(){var S=document.querySelectorAll("div[id^='mount_']");if(0<S.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<S.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"],i=["1"],d=["1"],r=l=a=1,socheck=s.length)}function n(e,t,n,o,a){d=0<S.length?(s=e.querySelectorAll('div[role="article"] span[dir="auto"] > a > span span[data-content='+t+"]"),c=e.querySelectorAll('div[role="article"] span[dir="auto"] > a > span span[data-content='+n+"]"),i=e.querySelectorAll('div[role="article"] span[dir="auto"] > a > span span[data-content='+o+"]"),e.querySelectorAll('div[role="article"] span[dir="auto"] > a > span span[data-content='+a+"]")):(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+"]"),i=e.querySelectorAll('.userContentWrapper h5 + div[data-testid*="sub"] a [data-content='+o+"]"),e.querySelectorAll('.userContentWrapper h5 + div[data-testid*="sub"] a [data-content='+a+"]")),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+"]"),i=e.querySelectorAll('.userContentWrapper h5 + div[data-testid*="label"] a [data-content='+o+"]"),d=e.querySelectorAll('.userContentWrapper h5 + div[data-testid*="label"] a [data-content='+a+"]"))}var o=0,a=0,l=0,r=0,s=0,c=0,i=0,d=0,u=e.querySelectorAll("div[style='width: 100%'] > a[href*='oculus.com/quest'] > div"),h=document.querySelector("[lang]"),p=document.querySelectorAll("link[rel='preload'][href*='/l/']");if(h)h=document.querySelector("[lang]").lang;else h="en";var f=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<f.length||0<g.length){if(m+=1,0<S.length){if(""==(y=e.querySelectorAll("a[href]")[0].innerText))var y=e.querySelectorAll("a[href]")[1].innerText;if(""==y)y=e.querySelectorAll("a[href]")[0].querySelectorAll("a[aria-label]")[0].getAttribute("aria-label")}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: "+f.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 if("af"==h)t(e,"Geborg");else if("de"==h||"nl"==h)n(e,"G","e","s","n");else if("am"==h)t(e,"የተከፈለበት ማስታወቂያ");else if("ar"==h)t(e,"مُموَّل");else if("as"==h)t(e,"পৃষ্ঠপোষকতা কৰা");else if("az"==h)t(e,"Sponsor dəstəkli");else if("co"==h)t(e,"Spunsurizatu");else if("bs"==h||"sl"==h||"cs"==h)n(e,"S","p","z","n");else if("da"==h||"en"==h||"et"==h||"fy"==h||"it"==h||"ku"==h||"nb"==h||"nn"==h||"pl"==h||"sq"==h||"sv"==h||"zz"==h){if(0<S.length)p[0].href.contains("en_UD")?t(e,"pəɹosuodS"):p[0].href.contains("ja_KS")?t(e,"広告"):n(e,"S","p","s","n");else if(document.querySelector("body").className.includes("Locale_en_UD"))t(e,"pəɹosuodS");else if(document.querySelector("body").className.includes("ja_KS"))t(e,"広告");else if(n(e,"S","p","s","n"),0==o&&0==a&&0==l&&0==r){s=e.querySelectorAll('.userContentWrapper h5 + div[data-testid*="sub"] > span a > [class] [class]');for(socheck=0;socheck<s.length;socheck++)s[socheck].innerText.contains("S")&&(o=1),s[socheck].innerText.contains("p")&&(c=["1"],a=1),s[socheck].innerText.contains("s")&&(i=["1"],l=1),s[socheck].innerText.contains("n")&&(d=["1"],r=1)}}else"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<S.length?p[0].href.contains("fr_FR")?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<i.length&&0<d.length){for(cont=0;cont<s.length;cont++)0<s[cont].offsetHeight&&(cont=s.length,o=1);for(cont1=0;cont1<c.length;cont1++)0<c[cont1].offsetHeight&&(cont1=c.length,a=1);for(cont2=0;cont2<i.length;cont2++)0<i[cont2].offsetHeight&&(cont2=i.length,l=1);for(cont3=0;cont3<d.length;cont3++)0<d[cont3].offsetHeight&&(cont3=d.length,r=1);if(1==o&&1==a&&1==l&&1==r){if(0<S.length)y=e.querySelectorAll("a[href]")[1].innerText;else if(""==y)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})}();
 
Last edited:

giodeluigi

New Member
Blaz and Boo Berry thanks for helping!
Just switched to the new interface (dark mode finally) and after a page reload, quit and reopen Chrome, sponsored ads are gone even in the new interface!
Nice job guys!
 

giodeluigi

New Member
Now after a Chrome quit and reopen sponsored ads seem to be gone again...
I think this thing needs some more testing...
I'll play a little more with the new interface then I let you know.
 

Blaz

Moderator & Translator
Staff member
Moderator
Did you encounter any ads on new interface meanwhile?

EDIT: Tweaked rule to include fix for e. g. Russian:
Code:
facebook.com,facebookcorewwi.onion#%#!function(){var e=new MutationObserver(function(){var S=document.querySelectorAll("div[id^='mount_']");if(0<S.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(0<S.length?"0"==(s=e.querySelectorAll('div[role="article"] span[dir="auto"] > a > span > span > span[data-content]')).length&&(s=e.querySelectorAll('div[role="article"] span[dir="auto"] > a > span[aria-label]')):s=e.querySelectorAll('.userContentWrapper h5 + div[data-testid*="sub"] a [class] [class]'),socheck=0;socheck<s.length;socheck++)s[socheck].innerText.contains(t)&&(c=["1"],i=["1"],d=["1"],r=l=o=1,socheck=s.length)}function n(e,t,n,a,o){d=0<S.length?(s=e.querySelectorAll('div[role="article"] span[dir="auto"] > a > span span[data-content='+t+"]"),c=e.querySelectorAll('div[role="article"] span[dir="auto"] > a > span span[data-content='+n+"]"),i=e.querySelectorAll('div[role="article"] span[dir="auto"] > a > span span[data-content='+a+"]"),e.querySelectorAll('div[role="article"] span[dir="auto"] > a > 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+"]"),i=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+"]"),i=e.querySelectorAll('.userContentWrapper h5 + div[data-testid*="label"] a [data-content='+a+"]"),d=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,i=0,d=0,u=e.querySelectorAll("div[style='width: 100%'] > a[href*='oculus.com/quest'] > div"),h=document.querySelector("[lang]"),p=document.querySelectorAll("link[rel='preload'][href*='/l/']");if(h)h=document.querySelector("[lang]").lang;else h="en";var f=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<f.length||0<g.length){if(m+=1,0<S.length){if(""==(y=e.querySelectorAll("a[href]")[0].innerText))var y=e.querySelectorAll("a[href]")[1].innerText;if(""==y)y=e.querySelectorAll("a[href]")[0].querySelectorAll("a[aria-label]")[0].getAttribute("aria-label")}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: "+f.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 if("af"==h)t(e,"Geborg");else if("de"==h||"nl"==h)n(e,"G","e","s","n");else if("am"==h)t(e,"የተከፈለበት ማስታወቂያ");else if("ar"==h)t(e,"مُموَّل");else if("as"==h)t(e,"পৃষ্ঠপোষকতা কৰা");else if("az"==h)t(e,"Sponsor dəstəkli");else if("co"==h)t(e,"Spunsurizatu");else if("bs"==h||"sl"==h||"cs"==h)n(e,"S","p","z","n");else if("da"==h||"en"==h||"et"==h||"fy"==h||"it"==h||"ku"==h||"nb"==h||"nn"==h||"pl"==h||"sq"==h||"sv"==h||"zz"==h){if(0<S.length)p[0].href.contains("en_UD")?t(e,"pəɹosuodS"):p[0].href.contains("ja_KS")?t(e,"広告"):n(e,"S","p","s","n");else if(document.querySelector("body").className.includes("Locale_en_UD"))t(e,"pəɹosuodS");else if(document.querySelector("body").className.includes("ja_KS"))t(e,"広告");else if(n(e,"S","p","s","n"),0==a&&0==o&&0==l&&0==r){s=e.querySelectorAll('.userContentWrapper h5 + div[data-testid*="sub"] > span a > [class] [class]');for(socheck=0;socheck<s.length;socheck++)s[socheck].innerText.contains("S")&&(a=1),s[socheck].innerText.contains("p")&&(c=["1"],o=1),s[socheck].innerText.contains("s")&&(i=["1"],l=1),s[socheck].innerText.contains("n")&&(d=["1"],r=1)}}else"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<S.length?p[0].href.contains("fr_FR")?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<i.length&&0<d.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<i.length;cont2++)0<i[cont2].offsetHeight&&(cont2=i.length,l=1);for(cont3=0;cont3<d.length;cont3++)0<d[cont3].offsetHeight&&(cont3=d.length,r=1);if(1==a&&1==o&&1==l&&1==r){if(0<S.length){if(""==(y=e.querySelectorAll("a[href]")[1].innerText))y=e.querySelectorAll("a[href]")[2].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})}();
 
Last edited:

Blaz

Moderator & Translator
Staff member
Moderator
It should not work since the change was in a function which is not called by EN_US interface, only in other languages like Russian.
Please send me your AnyDesk ID via PM and I can check.
Somehow I think they use the same styling for new interface like they did for old interface in your case.
 

giodeluigi

New Member
It should not work since the change was in a function which is not called by EN_US interface, only in other languages like Russian.
Please send me your AnyDesk ID via PM and I can check.
Somehow I think they use the same styling for new interface like they did for old interface in your case.
In the meanwhile I can confirm this code is not working with English US user interface language.
 

Boo Berry

Moderator + Beta Tester
Moderator
I've yet to see any ads on the new Facebook design, and I'm using the US English site.
 
Top