Blocking whole protocol

Various discussions related to Adblock Plus development
Post Reply
oroep
Posts: 2
Joined: Sun Aug 28, 2016 12:47 pm

Blocking whole protocol

Post by oroep »

I'd like to block a whole protocol on my browser (the `market://` protocol).

I tried to add `market://*` to the filters, but it didn't work.

Is there any way to do that?
User avatar
smed79
Posts: 1224
Joined: Thu Jan 14, 2010 11:51 pm
Location: EasyList Forum
Contact:

Re: Blocking whole protocol

Post by smed79 »

You mean hide ?
Have you a test page/site?
lewisje
Posts: 2743
Joined: Mon Jun 14, 2010 12:07 pm

Re: Blocking whole protocol

Post by lewisje »

ABP only blocks HTTP and HTTPS, and I believe an attempt to navigate to a market: URL doesn't trigger an HTTP request within the browser (instead just launching the Play Store), so ABP is not able to monitor the navigation (a similar reason is why data: URIs cannot be blocked outright).

It is possible to hide links to market: URLs, but you're probably more concerned about sites that automatically redirect you to the Play Store, and hiding rules can't help with that.
There's a buzzin' in my brain I really can't explain; I think about it before they make me go to bed.
oroep
Posts: 2
Joined: Sun Aug 28, 2016 12:47 pm

Re: Blocking whole protocol

Post by oroep »

The `market:` URIs open the Google Play Store on Android devices, and an example can be found on the chat of Facebook's mobile website.

Thanks for the explanation @lewisje. I didn't know ABP couldn't block URIs, and yeah, I care about blocking the URI, not just the link.

If I can go off topic: do you know whether there's any way to block these URIs? Anything that can be done on a rooted device? Or can this feature be implemented in the Adblock Plus browser?
lewisje
Posts: 2743
Joined: Mon Jun 14, 2010 12:07 pm

Re: Blocking whole protocol

Post by lewisje »

oroep wrote:I didn't know ABP couldn't block URIs
It can, as long as they're HTTP or HTTPS (or soon, apparently, WS and WSS, for WebSockets).
There's a buzzin' in my brain I really can't explain; I think about it before they make me go to bed.
User avatar
greiner
ABP Developer
Posts: 899
Joined: Mon Sep 03, 2012 5:29 pm
Location: Cologne, Germany

Re: Blocking whole protocol

Post by greiner »

oroep wrote:I'd like to block a whole protocol on my browser (the `market://` protocol).

I tried to add `market://*` to the filters, but it didn't work.

Is there any way to do that?
Links with protocols other than the ones the browser can handle (i.e. http, https, ftp, ftps, etc.) are usually passed on to the operating system so there's no navigation happening in the browser that the extension could cancel as far as I'm aware of. So as lewisje mentioned hiding those links would be one option. Another one would be to write a GreaseMonkey script to intercept clicks on those links - similarly to how we do it with abp:subscribe links (see https://hg.adblockplus.org/adblockplusc ... ostload.js) or even better to rewrite them to working https://play.google.com links.
Post Reply