
Loading…
zippyshare www?? prefix rules #1270
Please explain what you want to achieve, and what you have done so far, so that we can assist you further.
If you want to match all resources loaded from www??.zippyshare.com but not the base domain or other subdomains, it's probably best to use a regex: /\/\/www[0-9]{2}\.zippyshare\.com/
If you want the rules to apply when the URL in the address bar has www??.zippyshare.com but not the base domain or other subdomains, the only way is to make a rule with 100 domain specifiers, like adserver.js$domain=www00.zippyshare.com|www01.zippyshare.com|...|www98.zippyshare.com|www99.zippyshare.com and so on.
If, however, you're okay with matching the base domain and other subdomains, it's much better to use, respectively, ||zippyshare.com^ and adserver.js$domain=zippyshare.com
I meant to start that with a forward slash, because in Javascript, regexes start with forward slashes, by which I mean un-escaped forward slashes.
Also, I wasn't escaping backslashes, I was escaping forward slashes, which do need to be escaped because otherwise they mark the beginning and end of regexes (backslashes also need to be escaped if they're meant literally, but they rarely appear in URLs anyway so you won't see this much).
I'm thinking in PCRE too, because Javascript regex literals are based on a subset of it (where, among other things, you don't have a choice of delimiter; it must be a forward slash); however, now that I think about it, if uBlock generates the regexes with new RegExp(string) rather than somehow reading it directly as a regex literal, maybe I don't need to escape special characters other than the backslash (which is also the escape character in strings) after all...maybe I should test that or look directly into the code.
Ok i went to a zippyshare page.. and used the picker to select elements to hide and the rules created are as follows
! 19/04/2015 17:19:12 http://www10.zippyshare.com/v/NqqAFkFS/file.html
www10.zippyshare.com###lrbox > .slickbox > .center
! 19/04/2015 17:19:24 http://www10.zippyshare.com/v/NqqAFkFS/file.html
www10.zippyshare.com###lrbox > .slickbox > .left:nth-of-type(3)
! 19/04/2015 17:19:32 http://www10.zippyshare.com/v/NqqAFkFS/file.html
www10.zippyshare.com###lrbox > .slickbox > .right:nth-of-type(3)
as you see this file is stored on the www10.zippyshare.com they have different servers so the 10 can change, to be honest the rule will be fine running on the whole of the domain so basically anything which has zippyshare.com at the end.
But to be more precise as some of the results have show it would be better to put a ? wildcard to cover the www and then not be bothered by the server number added
so then i tried different combinations
||zippyshare.com^###lrbox > .slickbox > .center
||zippyshare.com^###lrbox > .slickbox > .left:nth-of-type(3)
/\/\/www[0-9]{2}.zippyshare.com/###lrbox > .slickbox > .right:nth-of-type(3)
/\/\/www[0-9]{2}.zippyshare.com/###bottom
but then visting a different page
http://www13.zippyshare.com/v/2KazPtfa/file.html?hc_location=ufi
the rules arent applied so i presume its something to do with syntax
thanks for the input so far.. i
oh oh oh, you're looking for hiding rules
Well, the only thing you can put to the left of the ## is a list of domain specifiers, so you would need 100 domains in the list to cover specifically those subdomains of zippyshare.com, like "www01.zippyshare.com,www02.zippyshare.com,...,www98.zippyshare.com,www99.zippyshare.com###lrbox > .slickbox > center"
but if you're okay with covering zippyshare.com and all subdomains, even those not of the form www??, then you can just use rules like this:
zippyshare.com###lrbox > .slickbox > .center
To be clear, an element-hiding filter can consist only of a list of domain specifiers, followed by ##, followed by a valid CSS selector supported by the browser (CSS3 is a good baseline); if the list of domain specifiers is empty, the rule applies to all domains, and otherwise it is a comma-separated list of domains, each optionally prepended by ~, and then the rule applies on those domains not prepended by ~ and their subdomains, but not on those domains prepended by ~ and their subdomains. Element-hiding whitelists are similar, but instead of ## they use #@# (this is different from the $elemhide option in a regular whitelist filter, which just says that element-hiding is disabled on pages matching the URL pattern): https://adblockplus.org/en/filters
The syntax isn't like blocking filters at all; not even the typical rules (like $domain=zippyshare.com) work.
@devouk Sorry for not having gotten back to you about this.
@lewisje Thanks for your helpful comments so far! Appreciate your help with the issues. Like you said, it seems to me like
zippyshare.com###lrbox > .slickbox > .center
is probably what @devouk wants. That will match all subdomains of zippyshare.com, including www22.zippyshare.com, etc.
thanks for the clearer description and now the understanding about blocking and hiding, which i thought would be the same and glad to say this has worked. Thanks for all that put input which I couldnt see from the adblock filters .
many thanks
Hi
I am really stuggling to get a working rule for a certain site which prefixs on the www (www??) where ?? is a number.
The site in question is zippyshare when i create a rule it is specific to the www??.prefix but the rules for the container to hide the elements seem to work.
Been reading the adblock page but cant work it out ... can anyone point me in the right direction please