Blocking image with # in URL

Various discussions related to filter list maintenance

Moderator: njones

Post Reply
blockyblocky
Posts: 5
Joined: Wed Feb 15, 2017 11:20 pm

Blocking image with # in URL

Post by blockyblocky »

Hello,

I'm trying to add a custom rule to block images from an URL that looks like this:

||googleusercontent.com/proxy/<randomjunk>#<randomjunk><keyword><randomjunk>

I tried a few things including:

||googleusercontent/*keyword
||googleusercontent/proxy/*^*keyword

But I'm not having any luck. It seems like everything beyond the "#" is being ignored by AdBlock during the substring search. Is there an option to get access to the entire URL including the "intra-document" bookmark or link?

Thanks for any guidance.
User avatar
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: Blocking image with # in URL

Post by mapx »

- provide an example page, explaining what do you want to block
- "allow some non intrusive advertising" is ON or OFF ?
blockyblocky
Posts: 5
Joined: Wed Feb 15, 2017 11:20 pm

Re: Blocking image with # in URL

Post by blockyblocky »

The URL is incredibly long since its a google proxy image. But in particular it's a mailtrack.io signature for tracking when email is opened/loaded.

It looks like:

Code: Select all

https://ci4.googleusercontent.com/proxy/nYHC0Y6wjpp3us9QdVGymuqsjgPyobU6uTI5djEqn9PXuni4fzFP9WZdFwBs9A_EHD2Gr8g5loeOtftX92dkhl87ElPsQVjLaZ_1sQONR9_YJyBQJPnDfg89y62mSHN3NT9eGwO_nYOjAM3t=s0-d-e1-ft#<some identifying information plus the mailtrack.io url here>
It's that trailing identifying info I would like to use in my filter but everything past the "#" seems to be truncated when performing the match. For instance, going to the AdBlock tab in the chrome inspection window and using the "block this" button just adds the URL up to the pound sign to my custom filter list.
User avatar
smed79
Posts: 1224
Joined: Thu Jan 14, 2010 11:51 pm
Location: EasyList Forum
Contact:

Re: Blocking image with # in URL

Post by smed79 »

Should work

Code: Select all

||googleusercontent.com/proxy/*mailtrack.io$image
Reply to the second question of mapx :
"allow some non intrusive advertising" is ON or OFF ?
blockyblocky
Posts: 5
Joined: Wed Feb 15, 2017 11:20 pm

Re: Blocking image with # in URL

Post by blockyblocky »

Oops, missed that second part. Yes, the "Allow some non-intrusive advertising" is currently ON. I'll try your suggestion and report back. Thanks.
User avatar
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: Blocking image with # in URL

Post by mapx »

try disabling "allow some ..." and test again using one of your first filters
blockyblocky
Posts: 5
Joined: Wed Feb 15, 2017 11:20 pm

Re: Blocking image with # in URL

Post by blockyblocky »

So this did not work:
||googleusercontent.com/proxy/*mailtrack.io$image

This does but has the side effect of blocking a lot of images I would rather load:

||googleusercontent.com/proxy/

I tried turning off the "Allow some non-intrusive advertising" but that does not change the behavior. From my black box observation, it seems like the data past the # is ignored. Here is the raw URL in its entirety:

Code: Select all

<img width="0" height="0" class="m_8426399240988564322mailtrack-img gmail_msg" src="https://ci4.googleusercontent.com/proxy/nYHC0Y6wjpp3us9QdVGymuqsjgPyobU6uTI5djEqn9PXuni4fzFP9WZdFwBs9A_EHD2Gr8g5loeOtftX92dkhl87ElPsQVjLaZ_1sQONR9_YJyBQJPnDfg89y62mSHN3NT9eGwO_nYOjAM3t=s0-d-e1-ft#https://mailtrack.io/trace/mail/90666113e742debc407fd183eac2573bfa8bb738.png?u=1003006">
When I click the "Block Item" in the chrome inspect/Adblock tab, adblock adds this rule:

Code: Select all

||ci4.googleusercontent.com/proxy/nYHC0Y6wjpp3us9QdVGymuqsjgPyobU6uTI5djEqn9PXuni4fzFP9WZdFwBs9A_EHD2Gr8g5loeOtftX92dkhl87ElPsQVjLaZ_1sQONR9_YJyBQJPnDfg89y62mSHN3NT9eGwO_nYOjAM3t=s0-d-e1-ft
User avatar
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: Blocking image with # in URL

Post by mapx »

yeah, it seems to be a bug. In ABP for firefox is working fine, in ABP for chrome it does not.
User avatar
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: Blocking image with # in URL

Post by mapx »

blockyblocky
Posts: 5
Joined: Wed Feb 15, 2017 11:20 pm

Re: Blocking image with # in URL

Post by blockyblocky »

I'll go shotgun approach until that gets fixed. Thanks for your help.
lewisje
Posts: 2743
Joined: Mon Jun 14, 2010 12:07 pm

Re: Blocking image with # in URL

Post by lewisje »

Technically, the bit after the # (the fragment identifier) is not needed to determine what resource to request, so it is not sent to the server with the rest of the URL; then in some Web apps, JS in the response looks at the fragment identifier to figure out what resource(s) to request, and then continues to request content.

You could record the Web traffic to figure out where the image ultimately comes from, but for all I know, it might be a different URL each time.
There's a buzzin' in my brain I really can't explain; I think about it before they make me go to bed.
Post Reply