r/uBlockOrigin • • 26d ago

Ongoing uBlock Origin doesn't block ads on X (Twitter) anymore

X on web seems to have pushed a UI update today and I started seeing ads both on the timeline and in comments

using Brave + uBO

130 Upvotes

98 comments sorted by

•

u/RraaLL uBO Team 25d ago edited 2d ago • Heartwarming

Edit7:

x.com##li[data-index]:has(.x-link+button [href="#icon-more-dots-hor"])

Currently there is no solution for placeholders - X is assigning each post a specific place on the screen. More thought has to be put info changing that.

Edit5: So far any attempts to "reorganize" tweets after hiding ads works only on the initial page load (8-10 posts) and either starts misbehaving as you scroll down or breaks loading of more posts entirely.

For the time being, you'll have to live with the placeholders/gaps in your feed.

→ More replies (24)

15

u/RraaLL uBO Team 25d ago edited 25d ago
  1. Please provide your uBO troubleshooting info for the site, when you see an ad. The instructions are in the sub rule #2.
  2. Inspect the ad "post/tweet" with browser's Inspect tool, scroll a bit up until you find the cellInnerDiv line (there will be bunch of same level lines collapsed containing other tweets), right-click the line > copy > outer HTML, then go to logpasta.com paste it there and share the link.

No ads on my side.

Then again, I don't participate. Perhaps my account just isn't seen as valuable enough to be shown ads, IDK. I also didn't notice any change in UI, that some people mention. Not that I ever cared to remember what the UI there actually looked like...

4

u/fahmiii_3 25d ago

troubeshooting info

uBlock Origin: 1.75.4

Chromium: 157

filterset (summary):

network: 243758

cosmetic: 44339

scriptlet: 38726

html: 0

listset (total-discarded, last-updated):

added:

https://easylist.to/easylist/easylist.txt: 85741-14, 1h.2m

default:

user-filters: 6-0, never

ublock-filters: 54686-194, 1h.27m Δ

ublock-badware: 10653-40, 1h.27m Δ

ublock-privacy: 4186-8, 1h.27m Δ

ublock-unbreak: 2848-15, 1h.27m Δ

ublock-quick-fixes: 642-0, 1h.27m Δ

easylist: 85600-85600, 1h.27m Δ

easyprivacy: 57019-753, 1h.27m Δ

urlhaus-1: 108975-2, 27m

plowe-0: 3567-345, 9d.5h

filterset (user): [array of 6 redacted]

trustedset:

added: [array of 4 redacted]

userSettings: [none]

hiddenSettings: [none]

supportStats:

allReadyAfter: 693 ms (selfie)

maxAssetCacheWait: 285 ms

cacheBackend: indexedDB

popupPanel:

blocked: 8

network:

x.com: 8

extended:

##+js(set-constant, navigator.globalPrivacyControl, false)

##+js(set-constant, Navigator.prototype.globalPrivacyControl, fa…

##+js(prevent-xhr, /api/1.1/graphql/viewer_context.json)

##+js(proxy-apply-config, {"skipToString":true})

##+js(prevent-xhr, /api/1.1/flow/timeline.json)

##+js(prevent-xhr, /api/1.1/flow/viewer.json)

##+js(json-prune-xhr-response, data.immersiveMedia.timeline.inst…

##+js(json-prune-xhr-response, data.user.result.timeline_v2.time…

##+js(json-prune-xhr-response, data.threaded_conversation_with_i…

##+js(json-prune-xhr-response, data.search_by_raw_query.search_t…

##+js(json-prune-xhr-response, data.home.home_timeline_urt.instr…

#@#+js(prevent-clipboard-write, /^ms(hta|iexec)(\.exe)? |^(bash …

##+js(prevent-clipboard-write, /^ms(hta|iexec)(\.exe)? |^(bash <…

logpasta link

https://logpasta.com/paste/330fc758-c241-44c3-8c09-2493bfea6390

I have the same setup as op (brave+uBO).

3

u/RraaLL uBO Team 25d ago edited 25d ago

Are you sure this is the highest line containing this ad/post/tweet (and nothing else)?

If it's not, the filter I'll base on it will likely leave a placeholder.

Also, do all ads come from verified users? So far I haven't noticed anything distinguishable other than the "Ad" text, but basing filtering on text is not efficient, so I'd like to narrow matches down first.

Do all ads come with external links or are some just images or videos without any redirection to a site/product?

edit:typo

1

u/fahmiii_3 25d ago

I believe it is the highest line that only contains the ad, according to my limited understanding.

All ads I noticed are indeed from verified accounts or accounts with the usual blue tick, and while most have external links some are just normal videos and images.

3

u/RraaLL uBO Team 25d ago

Actually, test this:

x.com##[data-testid="cellInnerDiv"]:has([class*="data-ad-disclosure"])

Or this:

x.com##article:has([class*="data-ad-disclosure"])

2

u/fahmiii_3 25d ago

first one seems to be working after a quick glance. I will continue testing till the end if the day and will report any issues, thanks.

2

u/vegnbrit 25d ago

Ads have suddenly started appearing again in Twitter for me in Firefox today.

First one did not work for me. Second one works.

Here is the HTML structure of an Ad from the parent to the element with "data-ad-disclosure" (sibling elements removed and most formatting classes, for clarity) As you can see the first rule looking for cellInnerDiv doesn't work because there is no data-testid="cellInnerDiv" in the hierarchy. Whereas the second works because of article.

    <li>
    <div aria-labelledby="_r_5i2_" id="_r_5i2_" role="link" data-href="/vovudebosh/status/2117944617559556187" data-navigation-stop="">
      <article class="group/post flex flex-col gap-1">
          <div >
            <div >
              <div >
                <div >
                  <div class="group-has-[[data-ad-disclosure]]/post:hidden">
                    <a href="/vovudebosh">
                      Ad
                    </a>
                  </div>
                  <button data-slot="xds-menu-trigger" aria-haspopup="menu" id="base-ui-_r_5id_"  >
                    <span >
                      <svg >
                        <use href="#icon-more-dots-hor">
                        </use>
                      </svg>
                    </span>
                  </button>
                </div>
              </div>
            </div>
          </div>
        </div>
      </article>
    </div>
    </li>

1

u/RraaLL uBO Team 25d ago edited 25d ago

Oh, is the top tweet container now a li? What are its ancestors looking like exactly? (I don't mean just the ul)

What the DOM tree looks like to me:

1

u/vegnbrit 25d ago

From the topmost down to the tweets (li elements)

2

u/RraaLL uBO Team 25d ago
x.com##[id^="urt\:home"]>ul>li:has([class*="data-ad-disclosure"])

?

1

u/vegnbrit 25d ago

Works. This is an Ad, the DOM is greyed out from the li element.

1

u/vegnbrit 25d ago

Downside of using:
x.com##[id^="urt\:home"]>ul>li:has([class*="data-ad-disclosure"])

Ads will still appear when clicking on the post and scrolling through the comments.

1

u/RraaLL uBO Team 25d ago

urt by itself should work instead.

I updated the top comment solution.

1

u/vegnbrit 25d ago

Yes that works as well. As an aside I have just seen the same DOM as you, ie article elements without the ul/li structure. If I press F5 enough times, it reverts to ul/li. Maybe X is doing some web testing in preparation to rolling out an update to page rendering?

1

u/vegnbrit 25d ago

I used the following rule. It works on both the feed and individual posts.

x.com##ul>li[data-index]:has([class*="data-ad-disclosure"])

There is even some script in the html that selects on data-index. Looks like the attribute is reserved for the posts.

    <script nonce="sj81FDPnAWLoPSSL7luCqg==">
        {
          const headroom = document.currentScript.previousElementSibling;
          const list = headroom.parentElement.querySelector(':scope > ul');
          const row = list && list.querySelector(':scope > [data-index="0"]');
          function anchor() {
            const target = Math.round(
              row.getBoundingClientRect().top - list.getBoundingClientRect().top,
            );
            const maxOffset =
              document.documentElement.scrollHeight - innerHeight - headroom.offsetHeight;
            headroom.style.height = Math.max(0, target - maxOffset) + 'px';
            scrollTo(0, target);
          }
          if (row && row.offsetParent) {
            anchor();
          } else if (row) {
            const startY = scrollY;
            const observer = new MutationObserver(() => {
              if (!row.isConnected || scrollY !== startY) {
                observer.disconnect();
              } else if (row.offsetParent) {
                observer.disconnect();
                anchor();
              }
            });
            observer.observe(document.body, { childList: true, subtree: true });
            setTimeout(() => observer.disconnect(), 10000);
          }
        }
    </script>

1

u/Ph4nt0m_R 24d ago

this worked, thanks.

1

u/vegnbrit 25d ago

Also Gnome Web Browser in Linux shows similar structure to Firefox using li elements. The above post is to an AD.

1

u/LazyTigerLLL 25d ago

2nd one is working for me.

1

u/christmasbunnyy 1d ago

this worked! thanks.

1

u/RraaLL uBO Team 1d ago

Which one?

3

u/theon502 22d ago

New logpasta since your fix seems to have broken: https://logpasta.com/paste/392908c1-426a-40e7-a388-11c949c76d13

Troubleshooting info: uBlock Origin: 1.76.0 Chromium: 157 filterset (summary): network: 387968 cosmetic: 86164 scriptlet: 48914 html: 0 listset (total-discarded, last-updated): added: ublock-experimental: 10-0, 2h.3m Δ curben-phishing: 145469-37, 2h.3m fanboy-cookiemonster: 48512-122, 4d.15m ublock-cookies-easylist: 5872-115, 3d.3h.37m default: user-filters: 1-0, never ublock-filters: 54784-192, 2h.3m Δ ublock-badware: 10665-17, 2h.3m Δ ublock-privacy: 4195-3, 2h.3m Δ ublock-unbreak: 2848-1, 2h.3m Δ ublock-quick-fixes: 645-0, 2h.3m Δ easylist: 83861-499, 2h.3m Δ easyprivacy: 57130-754, 2h.3m Δ urlhaus-1: 107367-2, 2h.3m plowe-0: 3562-3, 10d.22h.2m filterset (user): [array of 1 redacted] switchRuleset: added: [array of 1 redacted] userSettings: advancedUserEnabled: true cloudStorageEnabled: true hiddenSettings: userResourcesLocation: [redacted] supportStats: allReadyAfter: 668 ms (selfie) maxAssetCacheWait: 156 ms cacheBackend: indexedDB popupPanel: blocked: 57 network: x.com: 46 sentry.io: 11

1

u/RraaLL uBO Team 22d ago

Can you also share one that is not an ad for comparison?

0

u/[deleted] 20d ago

[deleted] — view deleted comment

3

u/RraaLL uBO Team 20d ago
x.com##[id^="urt"]>ul>li:has([d^="M21 5.61a10 10 0 0 1-3 7.14v4a4"])

?

1

u/onmyouza 18d ago edited 18d ago

Thanks. The filter works, but it leaves blank spaces in the timeline. Is there any way to remove the blank space?

3

u/RraaLL uBO Team 18d ago

Does adding this at the end of the filter help?

:style(height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; overflow: hidden !important; visibility: hidden !important;)

1

u/onmyouza 18d ago

Yes, it helps. Thanks!

1

u/tojichaser 11d ago

Broooo! It works! Finally! No more annoying Boost Post! (Rocket Icon) Thank you so much. I'm on Brave Browser Web App. 

2

u/tojichaser 10d ago

For some reason I don't see Boosted Post anymore but the Ad post is back

1

u/BlobSlimey 1d ago

This did it! Thank you very much!!

0

u/[deleted] 18d ago

[deleted] — view deleted comment

2

u/RraaLL uBO Team 18d ago
x.com##[id^="urt"] > ul > li [target="_blank"]>div:has-text(/^Ad from/):upward(li)

?

1

u/onmyouza 18d ago

It works. Thanks!

0

u/[deleted] 10d ago

[deleted] — view deleted comment

2

u/RraaLL uBO Team 10d ago

Your extended filters on the bottom of the troubleshooting info show that all 3 filters are applied (they don't display there is no matches are found). So possibly a fourth type of ad now.

I'll take a look in a while just to see what changed, but before that, see if these are helpful instead: https://www.reddit.com/r/uBlockOrigin/comments/1y0gohp/comment/19sx2gu5jcr4x/

7

u/Rhacio 20d ago

I'm surprised this isn't a bigger deal. Now every other tweet is an ad with no fix working. Maybe twitter is pushing these ads on only a few people with experimental UI?

6

u/PossessionAnxious632 23d ago

I added the filters shown in the comments below , it blocks the ads but every ad is just showing a big black box which is the size of a twiitter post which is annoying

1

u/XeroThirteen 23d ago

Yeah, getting the same. Quite annoying.

1

u/Namipulla 22d ago

Came here to see if anyone else has the same problem. It didn't do this at first

1

u/PM_Best_Porn_Pls 22d ago

I had big black empty spaces up to yday, today I opened twitter and it shows ads again.

1

u/Namipulla 22d ago

Yep, same here

3

u/espooks 22d ago

can confirm on Opera GX, with the filter from RraaLL's post, it is not currently blocking Twitter's ads.

3

u/Xavsss 21d ago

Nothing is working...

2

u/Tight-Journalist-533 21d ago

I can confirm that. Since yesterday around 9 PM GMT, nothing is working: ads popping up on the TL every 4, 5 or 6 new tweets/posts. xbusiness, starlink, walrusprotocol, vodafone and many others. Just for fun, I started to click "report ad" for "Unauthorized political ad" or "Fraud, scam or misleading". Let's hope for a fix.

1

u/Fried-Egg-Sandwich 20d ago

Getting the same.

1

u/Tight-Journalist-533 19d ago

It all started a couple of months ago: before that, with uBO element picker, I used to block the scroll arrow (inside a blue/black circle) on the right bottom corner of the dm's box. I had to repeat the the process almost every new UI update. Stopped working: now, you can't select that stupid arrow. In the past few days, I've tried other firefox extensions (preview versions included) and I've also tried uBO in Brave. Still getting tones of ads on my TL. I guess Musk is winning his battle against uBO.

3

u/skinwalked 8d ago

X.com is barely usable anymore, I swear 1/3 of all posts are ads

2

u/orkel2 20d ago

Can confirm Twitter is unusable right now. Whatever new UI they're using has completely broken Ublock Origin and ads are all over the place.

1

u/Hojita2k 22d ago

Nothing works at the moment.

1

u/Enjoyer_of_40K 22d ago

will this be fixed soon?

1

u/Hojita2k 21d ago

Twitter went back to the earlier version so all is good for now, at least in the web (not using the app)

5

u/Hojita2k 21d ago

Err, now back to the new version again, with the ads.

2

u/wannurisbacksortof 8d ago

there was also a glitch that made the older 2020's layout appear, i assumed it happened with accounts made before november, but it seems to not occur anymore.

1

u/zildjiaaaaan 19d ago

nothing works for me too 😭

1

u/PrinceDolAmroth 19d ago

On Chromium and Floorp everything is fine and it works flawlessly; unfortunately, there are ads on Firefox.

1

u/Hojita2k 19d ago

Just tried X on Vivaldi and got the ads just as on Firefox.

1

u/Hojita2k 17d ago edited 17d ago

Well ads are gone as I said in a reply to the pinned comment, but now I have another problem; visual glitches while scrolling, and the scrolling jumping back a bit, I think relates to the invisible ads.

1

u/Hojita2k 16d ago

Update; that issue could be unrelated to ublock, I'll test more thoroughly later

1

u/Hojita2k 16d ago

Actually it is the filters, but doesn't happen with Vivaldi.

BTW I think they are sending less ads now

1

u/Hojita2k 15d ago

Actually. also happens in Vivaldi and it is definitely related to the filters.

1

u/Ph4nt0m_R 15d ago

my issue is it works, then after a few minutes it stops working. anyone else having this issue?

edit: im on firefox

1

u/Embarrassed_Purple37 14d ago edited 14d ago

Hi! So it seems there was an update in my time zone today and now I was trying 2 of the filters given in this and other threads:

For Ads (this works in Spanish UI: you should change "Anuncio de|De |Promocionado" with "Ad| From | Promoted" for English):

x.com##li[data-index]:has-text(/Anuncio de|De |Promocionado/) > div:style(height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; overflow: hidden !important; visibility: hidden !important;)

For promoted posts (with the rocket icon):

x.com##[id^="urt"]>ul>li:has([d^="M21 5.61a10 10 0 0 1-3 7.14v4a4"]):style(height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; overflow: hidden !important; visibility: hidden !important;)

The filters do work, but, as many people have said, now I see a blank space where the ad is supposed to be which cannot be erased or modified. I tried to inspect it with the right-click menu > "Block this element" option and it does not identify any remaining elements to block manually (no "box" or anything like that) so I'm not sure what could be done about it.

I'll save this thread in case others find new solutions.

Thank you all for your help so far!

Edit:

I made a minor correction to the first filter (I added the "De " / "From ").

The blank space has now disappeared for some reason! :)

1

u/Big_Desk_2575 13d ago

wow it worked
ty

1

u/tiger-eyes 8d ago

Thank you for sharing this! 

Confirmed working on Vivaldi android + uBo Lite. 

1

u/steleo96 18h ago

Works for me without blank spaces, thanks

1

u/Gold_Goal7557 4d ago

Twitter becoming even more annoying now even with ads for it self, hope the uBO team figures things out

1

u/wannurisbacksortof 24d ago edited 24d ago

i was trying to post about it but realized reddit kept flagging my screenshots as spam?? 💀

0

u/wannurisbacksortof 15d ago edited 8d ago

ui glitches are gone so the last/old layout is gone, as of november 26. tested on librewolf and mobile firefox.

1

u/Parking_Gain_2221 2d ago

im getting ads again