Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update twitter: https://github.com/uBlockOrigin/uAssets/issues/20792 #20813

Merged
merged 4 commits into from Nov 22, 2023

Conversation

D4niloMR
Copy link
Contributor

fix flickering/ads in opened images
@D4niloMR
Copy link
Contributor Author

The only account I have that show ads for me is paywalled now, I can't test more. But from what I tested it's working fine.
image

@Yuki2718
Copy link
Contributor

Yuki2718 commented Nov 22, 2023

But why :remove()? Don't use it unless necessary. On my end it doesn't cover all what were covered by ##[data-testid="primaryColumn"] [data-testid="cellInnerDiv"]:has([data-testid="top-impression-pixel"]).

@D4niloMR
Copy link
Contributor Author

D4niloMR commented Nov 22, 2023

But why :remove()?

This is what prevented #20792 (comment) on my end

@Yuki2718
Copy link
Contributor

This is what prevented #20792 (comment) on my end

Okay, but can you restore the original rule as I'm not sure if the new rule covers all?

@D4niloMR
Copy link
Contributor Author

This works to you? removing [data-testid="cellInnerDiv"] causes breakage to me.
twitter.com##[data-testid="primaryColumn"] [data-testid="cellInnerDiv"] > div:has([data-testid="top-impression-pixel"]):remove()

image
image

It should work, maybe the [aria-label^="Timeline:"] is in another language to you?

@Yuki2718
Copy link
Contributor

Yuki2718 commented Nov 22, 2023

Yes, aria-label is language-dependent. The rule seems to work.

@Yuki2718 Yuki2718 merged commit ef2a714 into uBlockOrigin:master Nov 22, 2023
@Yuki2718
Copy link
Contributor

Thanks

@D4niloMR
Copy link
Contributor Author

D4niloMR commented Nov 22, 2023

Ok, maybe it still has ads in opened images though, but I can't test #20813 (comment)

e.g.:
https://twitter.com/gorhill/status/996016461943574528/photo/1

@D4niloMR D4niloMR deleted the patch-1 branch November 22, 2023 13:18
@DaisukeDaisuke
Copy link

maybe it still has ads in opened images though

Ads next to the image will still be displayed
In my opinion AdGuard – Ads removes this, so I don't think it's anything to worry about

open image

Desktop Screenshot 2023 11 23 - 08 34 00 19

open Troubleshooting Information
uBlock Origin: 1.53.0
Chromium: 119
filterset (summary):
 network: 154605
 cosmetic: 122649
 scriptlet: 26970
 html: 0
listset (total-discarded, last-updated):
 removed:
  user-filters: null
  urlhaus-1: null
 added:
  adguard-social: 22021-34, 5m
  adguard-spyware: 72599-174, 5m
  adguard-spyware-url: 1329-5, 5m
  block-lan: 55-0, 5m
  fanboy-cookiemonster: 48997-225, 5m
  ublock-annoyances: 5887-57, 4m
  ublock-quick-fixes: 206-73, 4m
 default:
  JPN-1: 13797-5, 5m
  easylist: 75640-81, 5m
  easyprivacy: 32912-16327, 5m
  plowe-0: 3719-1171, 4m
  ublock-badware: 7479-147, 4m
  ublock-filters: 35700-235, 4m
  ublock-privacy: 735-228, 4m
  ublock-unbreak: 2154-87, 4m
filterset (user): [array of 1414 redacted]
trustedset:
 added: [array of 10 redacted]
switchRuleset:
 added: [array of 19 redacted]
userSettings:
 largeMediaSize: 1
hiddenSettings: [none]
supportStats:
 allReadyAfter: 2048 ms (selfie)
 maxAssetCacheWait: 573 ms
popupPanel:
 blocked: 12
 network:
  twitter.com: 9
  ads-twitter.com: 2
  google-analytics.com: 1
 extended:
  ##div[data-testid="trend"]:has(path[d$="10H8.996V8h7v7z"])
  ##[data-testid="trend"]:has-text(/Promoted|Gesponsert|Promociona…
  ##[data-testid="primaryColumn"] [data-testid="cellInnerDiv"] > d…
  ##html:style(overflow:auto!important)
  ##+js(trusted-set-cookie, d_prefs, MjoxLGNvbnNlbnRfdmVyc2lvbjoyL…

@D4niloMR
Copy link
Contributor Author

D4niloMR commented Nov 23, 2023

so I don't think it's anything to worry about

AdGuard – Ads is not enabled by default.

And maybe just twitter.com##[data-testid="cellInnerDiv"] > div:has([data-testid="top-impression-pixel"]) fix this. But as I mentioned earlier, I can't test properly because the only account I have(that has ads) it's paywalled.

Edit: this filter from AdGuard doesn't even use procedural filters: twitter.com##div[data-testid="cellInnerDiv"] > div > div[class] > div[class][data-testid="placementTracking"]

@DaisukeDaisuke
Copy link

DaisukeDaisuke commented Nov 23, 2023

And maybe just twitter.com##[data-testid="cellInnerDiv"] > div:has([data-testid="top-impression-pixel"])

When I added the filter I received to My Filters, it was fixed

open image

Desktop Screenshot 2023 11 23 - 09 18 50 44

@D4niloMR
Copy link
Contributor Author

When I added the filter I received to My Filters, it was fixed

Test if it has flickering please

@DaisukeDaisuke
Copy link

Do I need to disable my current uasset solution when testing?

@DaisukeDaisuke
Copy link

DaisukeDaisuke commented Nov 23, 2023

I've disabled everything, but no ads are displayed and flickering occurs
There was also a blank space

open image

image

@D4niloMR
Copy link
Contributor Author

There was also a blank space

Ok, so the :remove() seems necessary.

https://github.com/easylist/easylist/blob/edcb694e2ad52ad178b30b305d697b7ab079927c/easylist/easylist_specific_hide.txt#L4835

EasyList updated the filter, it's working?

@DaisukeDaisuke
Copy link

It does not work.
I either added one line of the EasyList filter I received to my filters or subscribed to the latest EasyList.

open image

Desktop Screenshot 2023 11 23 - 09 32 13 28

@D4niloMR
Copy link
Contributor Author

D4niloMR commented Nov 23, 2023

Well, so I can think in 2 filters:

twitter.com##[data-testid="cellInnerDiv"] > div:has([data-testid="top-impression-pixel"]):remove()

From AdGuard:
twitter.com##div[data-testid="cellInnerDiv"] > div > div[class] > div[class][data-testid="placementTracking"]:remove()

@DaisukeDaisuke
Copy link

twitter.com##[data-testid="cellInnerDiv"] > div:has([data-testid="top-impression-pixel"]):remove()

No ads, no flickering and white space, no ads next to images


twitter.com##div[data-testid="cellInnerDiv"] > div > div[class] > div[class][data-testid="placementTracking"]:remove()

Tweet corruption has occurred
Something went wrong. Try reloading.

open image

Desktop Screenshot 2023 11 23 - 09 47 49 76

Desktop Screenshot 2023 11 23 - 09 47 59 52

@D4niloMR
Copy link
Contributor Author

D4niloMR commented Nov 23, 2023

twitter.com##div[data-testid="cellInnerDiv"] > div > div[class] > div[class][data-testid="placementTracking"]:remove()

Tweet corruption has occurred Something went wrong. Try reloading.

Strange, the other one is removing the div even higher than that filter and no issue.


Btw, since I can't test it, I won't create a PR. Anyone who can test and make sure that the first filter works without breakage is free to do it. (Or anybody who can make a better solution)

Don't do duplicate PR/issue.

@stephenhawk8054
Copy link
Member

@Yuki2718 So, does twitter.com##div[data-testid="cellInnerDiv"] > div > div[class] > div[class][data-testid="placementTracking"] work on your side?

@D4niloMR
Copy link
Contributor Author

@stephenhawk8054
Copy link
Member

I don't use Twitter so I'm not sure

@Yuki2718
Copy link
Contributor

Yuki2718 commented Nov 23, 2023

My account still doesn't get the new ad. But as AG added the rule and some people say it worked, I'll add the rule to EL and Quick. Does the rule replace twitter.com#?#[data-testid="primaryColumn"] [data-testid="cellInnerDiv"]:-abp-has([data-testid="top-impression-pixel"])?

@DaisukeDaisuke

This comment was marked as off-topic.

@Yuki2718
Copy link
Contributor

The rule I mentioned above is just an areas of twitter.com##[data-testid="primaryColumn"] [data-testid="cellInnerDiv"]:has([data-testid="top-impression-pixel"]) in #20792 (comment)

@Yuki2718
Copy link
Contributor

@DaisukeDaisuke I wonder if twitter.com##div[data-testid="cellInnerDiv"] > div > div[class] > div[class][data-testid="placementTracking"] completely covers what were covered by twitter.com##[data-testid="primaryColumn"] [data-testid="cellInnerDiv"]:has([data-testid="top-impression-pixel"]). To test this, add

twitter.com#@?#[data-testid="primaryColumn"] [data-testid="cellInnerDiv"]:-abp-has([data-testid="top-impression-pixel"])
twitter.com#@#[data-testid="cellInnerDiv"] > div:has([data-testid="top-impression-pixel"]):remove()

to My filters and ignore the flickering issue. All I want to know is if no ads will be displayed.

@Yuki2718
Copy link
Contributor

I guess the flickering occurs only on the primaryColumn so limiting remove() to primaryColumn is not bad, unless twitter.com##div[data-testid="cellInnerDiv"] > div > div[class] > div[class][data-testid="placementTracking"]:remove() works fine, which was reportedly not.

@DaisukeDaisuke
Copy link

DaisukeDaisuke commented Nov 23, 2023

Sorry for the delay.
I added the following filter to My Filters and tested it after making sure that My Filters was checked

twitter.com#@?#[data-testid="primaryColumn"] [data-testid="cellInnerDiv"]:-abp-has([data-testid="top-impression-pixel"])
twitter.com#@#[data-testid="cellInnerDiv"] > div:has([data-testid="top-impression-pixel"]):remove()

All filters have been disabled: Ads will still be displayed

open Troubleshooting Information
uBlock Origin: 1.53.0
Chromium: 119
filterset (summary):
 network: 117
 cosmetic: 1250
 scriptlet: 8
 html: 0
listset (total-discarded, last-updated):
 removed:
  JPN-1: null
  easylist: null
  easyprivacy: null
  plowe-0: null
  ublock-badware: null
  ublock-filters: null
  ublock-privacy: null
  ublock-quick-fixes: null
  ublock-unbreak: null
  urlhaus-1: null
 default:
  user-filters: 1391-16, never
filterset (user): [array of 1396 redacted]
trustedset:
 added: [array of 10 redacted]
switchRuleset:
 added: [array of 19 redacted]
userSettings:
 largeMediaSize: 1
hiddenSettings: [none]
supportStats:
 allReadyAfter: 4949 ms
 maxAssetCacheWait: 67 ms
popupPanel:
 blocked: 0
open image

image


Only MyFilter and uAsset are enabled: no ads are displayed
open Troubleshooting Information
uBlock Origin: 1.53.0
Chromium: 119
filterset (summary):
 network: 15995
 cosmetic: 12316
 scriptlet: 19155
 html: 0
listset (total-discarded, last-updated):
 removed:
  JPN-1: null
  easylist: null
  easyprivacy: null
  plowe-0: null
  urlhaus-1: null
 default:
  user-filters: 1391-16, never
  ublock-badware: 7479-10, 5m
  ublock-filters: 35672-47, 5m
  ublock-privacy: 735-0, 5m
  ublock-quick-fixes: 197-72, 5m
  ublock-unbreak: 2151-2, 5m
filterset (user): [array of 1396 redacted]
trustedset:
 added: [array of 10 redacted]
switchRuleset:
 added: [array of 19 redacted]
userSettings:
 largeMediaSize: 1
hiddenSettings: [none]
supportStats:
 allReadyAfter: 4949 ms
 maxAssetCacheWait: 67 ms
popupPanel:
 blocked: 1
 network:
  google-analytics.com: 1
 extended:
  ##div[data-testid="cellInnerDiv"] > div > div[class] > div[class…
  ##[data-testid="trend"]:has-text(/Promoted|Gesponsert|Promociona…
  ##[data-testid="primaryColumn"] [data-testid="cellInnerDiv"] > d…
open image

Desktop Screenshot 2023 11 23 - 20 05 28 15


Only "My filters" and "Adguard - ads" are enabled: no ads are displayed

open Troubleshooting Information
uBlock Origin: 1.53.0
Chromium: 119
filterset (summary):
 network: 20320
 cosmetic: 42840
 scriptlet: 18046
 html: 0
listset (total-discarded, last-updated):
 removed:
  JPN-1: null
  easylist: null
  easyprivacy: null
  plowe-0: null
  ublock-badware: null
  ublock-filters: null
  ublock-privacy: null
  ublock-quick-fixes: null
  ublock-unbreak: null
  urlhaus-1: null
 added:
  adguard-generic: 80313-480, never
 default:
  user-filters: 1391-16, never
filterset (user): [array of 1396 redacted]
trustedset:
 added: [array of 10 redacted]
switchRuleset:
 added: [array of 19 redacted]
userSettings:
 largeMediaSize: 1
hiddenSettings: [none]
supportStats:
 allReadyAfter: 4949 ms
 maxAssetCacheWait: 67 ms
popupPanel:
 blocked: 0
 extended:
  ##div[data-testid="cellInnerDiv"]:has(> div article[data-testid=…
open image

Desktop Screenshot 2023 11 23 - 20 12 57 73


Only "My Filters" and EasyList" are enabled: Ads will be displayed

open Troubleshooting Information
uBlock Origin: 1.53.0
Chromium: 119
filterset (summary):
 network: 42747
 cosmetic: 30801
 scriptlet: 8
 html: 0
listset (total-discarded, last-updated):
 removed:
  JPN-1: null
  easyprivacy: null
  plowe-0: null
  ublock-badware: null
  ublock-filters: null
  ublock-privacy: null
  ublock-quick-fixes: null
  ublock-unbreak: null
  urlhaus-1: null
 default:
  user-filters: 1391-16, never
  easylist: 72196-15, never
filterset (user): [array of 1396 redacted]
trustedset:
 added: [array of 10 redacted]
switchRuleset:
 added: [array of 19 redacted]
userSettings:
 largeMediaSize: 1
hiddenSettings: [none]
supportStats:
 allReadyAfter: 4949 ms
 maxAssetCacheWait: 67 ms
popupPanel:
 blocked: 1
 network:
  ads-twitter.com: 1
 extended:
  ##div[data-testid="trend"]:has(path[d$="10H8.996V8h7v7z"])
open image

Desktop Screenshot 2023 11 23 - 20 15 05 12


"My Filters", "uAsset", " Easy List" and "Adguard - ads" are enabled: no ads are displayed

open Troubleshooting Information
uBlock Origin: 1.53.0
Chromium: 119
filterset (summary):
 network: 91389
 cosmetic: 45120
 scriptlet: 19155
 html: 0
listset (total-discarded, last-updated):
 removed:
  JPN-1: null
  plowe-0: null
  urlhaus-1: null
 default:
  user-filters: 1391-16, never
  easylist: 75644-16, 2m
  easyprivacy: 32972-64, 2m
  ublock-badware: 7479-137, 2m
  ublock-filters: 35672-159, 2m
  ublock-privacy: 735-4, 2m
  ublock-quick-fixes: 198-72, 2m
  ublock-unbreak: 2151-32, 2m
filterset (user): [array of 1396 redacted]
trustedset:
 added: [array of 10 redacted]
switchRuleset:
 added: [array of 19 redacted]
userSettings:
 largeMediaSize: 1
hiddenSettings: [none]
supportStats:
 allReadyAfter: 4949 ms
 maxAssetCacheWait: 67 ms
popupPanel:
 blocked: 6
 network:
  twitter.com: 4
  ads-twitter.com: 1
  google-analytics.com: 1
 extended:
  ##div[data-testid="trend"]:has(path[d$="10H8.996V8h7v7z"])
  ##[data-testid="trend"]:has-text(/Promoted|Gesponsert|Promociona…
  ##[data-testid="primaryColumn"] [data-testid="cellInnerDiv"] > d…
open image

Desktop Screenshot 2023 11 23 - 20 16 12 69

I deleted the post because there was a misunderstanding
This exclusion filter seems to only affect EasyList

@Yuki2718
Copy link
Contributor

Probably the latest EL is not yet available.

Only MyFilter and uAsset are enabled: no ads are displayed

Given this, I assume twitter.com##[data-testid="primaryColumn"] [data-testid="cellInnerDiv"]:has([data-testid="top-impression-pixel"]) can now be removed.

@Yuki2718
Copy link
Contributor

Done easylist/easylist@4cc5168 thanks for your cooperation.

@DaisukeDaisuke
Copy link

Thanks for the fix

The "uBlock filters – Quick fixes" I currently have is as follows, and no ads are displayed even if I use exclusion rules.
image

open Troubleshooting Information
uBlock Origin: 1.53.0
Chromium: 119
filterset (summary):
 network: 15994
 cosmetic: 12324
 scriptlet: 19155
 html: 0
listset (total-discarded, last-updated):
 removed:
  JPN-1: null
  easylist: null
  easyprivacy: null
  plowe-0: null
  urlhaus-1: null
 default:
  user-filters: 1390-16, never
  ublock-badware: 7479-10, now
  ublock-filters: 35679-47, now
  ublock-privacy: 735-0, now
  ublock-quick-fixes: 199-73, now
  ublock-unbreak: 2151-2, now
filterset (user): [array of 1395 redacted]
trustedset:
 added: [array of 10 redacted]
switchRuleset:
 added: [array of 19 redacted]
userSettings:
 largeMediaSize: 1
hiddenSettings: [none]
supportStats:
 allReadyAfter: 4265 ms
 maxAssetCacheWait: 55 ms
popupPanel:
 blocked: 1
 network:
  google-analytics.com: 1
 extended:
  ##[data-testid="trend"]:has-text(/Promoted|Gesponsert|Promociona…
  ##[data-testid="primaryColumn"] [data-testid="cellInnerDiv"] > d…

@Yuki2718
Copy link
Contributor

Yes, but we will keep the rule for the aforementioned flickering issue.

@uBlock-user
Copy link
Contributor

uBlock-user commented Nov 23, 2023

Ok, maybe it still has ads in opened images though, but I can't test #20813 (comment)

e.g.: https://twitter.com/gorhill/status/996016461943574528/photo/1

Yes, I see ad on url ending with /photo/1, need to add -- twitter.com##div[class][data-testid="placementTracking"]:has(div[class][data-testid$="-impression-pixel"])

@Yuki2718

@Yuki2718
Copy link
Contributor

@uBlock-user So ##div[data-testid="cellInnerDiv"] > div > div[class] > div[class][data-testid="placementTracking"] doesn't match?

@uBlock-user
Copy link
Contributor

Didn't test. The current filters do not work on pages ending with /photo/1 that I know for a fact.

@Yuki2718
Copy link
Contributor

I added the rule 5 hours ago f91aa32 BTW I wonder why nobody uses [data-testid="tweet"]. Shouldn't ##article[data-testid="tweet"]:has([data-testid="top-impression-pixel"]):remove() cover all?

@uBlock-user
Copy link
Contributor

I added the rule 5 hours ago f91aa32

Doesn't apply on pages url ending with /photo/1

Shouldn't ##article[data-testid="tweet"]:has([data-testid="top-impression-pixel"]):remove() cover all?

No, it won't. There are 4 types of ads, see below --

Capture

Yours only covers one type, while mine covers all 4.

@Yuki2718
Copy link
Contributor

Okay, so changing to ##article[data-testid="tweet"]:has([data-testid$="-impression-pixel"]):remove() as you originally suggested makes it to work?

@uBlock-user
Copy link
Contributor

I suggested twitter.com##div[class][data-testid="placementTracking"]:has(div[class][data-testid$="-impression-pixel"]), I haven't tested ##article[data-testid="tweet"]:has([data-testid$="-impression-pixel"]):remove() but if it works and doesn't break TL, then you may add it.

Yuki2718 added a commit that referenced this pull request Nov 23, 2023
Yuki2718 added a commit to easylist/easylist that referenced this pull request Nov 23, 2023
@Yuki2718
Copy link
Contributor

c3ae3a9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants