Page 1 of 1

Blocking whole protocol

Posted: Sun Aug 28, 2016 12:49 pm
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?

Re: Blocking whole protocol

Posted: Sun Aug 28, 2016 7:53 pm
by smed79
You mean hide ?
Have you a test page/site?

Re: Blocking whole protocol

Posted: Sun Aug 28, 2016 11:35 pm
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.

Re: Blocking whole protocol

Posted: Mon Aug 29, 2016 12:57 pm
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?

Re: Blocking whole protocol

Posted: Tue Aug 30, 2016 6:53 am
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).

Re: Blocking whole protocol

Posted: Mon Sep 05, 2016 2:45 pm
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.