Make a stylesheet apply to EVERY domain extension
I am trying to figure out what syntax to use to make every possible extension of a domain be effected by the same stylesheet but I can't seem to find that information anywhere which I just can't believe.
I KNOW there MUST be a way to do this it's such a basic thing you would want to do. I think.
For example thepiratebay.se and thepiratebay.vg both being effected by the same style rules
I'm thinking it's something as simple as
@-moz-document domain("thepiratebay.*")
but this doesn't work so I know the syntax is wrong but I can't for the life of me find how to do this.
I KNOW there MUST be a way to do this it's such a basic thing you would want to do. I think.
For example thepiratebay.se and thepiratebay.vg both being effected by the same style rules
I'm thinking it's something as simple as
@-moz-document domain("thepiratebay.*")
but this doesn't work so I know the syntax is wrong but I can't for the life of me find how to do this.
Comments
http:// thepiratebay.se/
https:// www. thepiratebay.se/
http:// www. thepiratebay.org/index.html
https:// thepiratebay.net/browse/
and so on
( edit: killed live links )
[a-z] Any character in the range a-z
[a-zA-Z] Any character in the range a-z or A-Z (any alphabetical character)
Is it a shorter way to write [a-zA-Z]\? (I escaped the question-mark therefore it is an actual question mark)
I also thought you had to use " " instead of ' ' in @-moz-document, but I guess it doesn't matter?
Remember it's \\? here :p
The 'proper way' of matching only upper and lower case letters is by is doing the [A-Za-z] as the [A-z] will match all characters _between_ upper case A to lowercase z, this could result in positive matches for some special characters as well ( [\]^_` ).
Also it has to be upper to lower case (A-z) as shown in the ansi&/ascii character map, doing the opposite will prevent you from saving the style. Doesn't seem to matter, when I write regexp I tend to prefer the ' to make myself aware that I'm actually writing a script, jason also seem to use it for his @-moz documentation, regexp or not.
Thanks for the explanation. I understood almost all of it.
No problem!
You forgot that domain name only use lower case, so
a-z
is enough.edit; in short, if a certain browser or browser version treats upper and lower case different / accepts it (i remember something with safari on MacOS being weird on .COM and the other most common TLDs) then I still want to support it, if a site treats upper and lower case different or "forces it" (like how jQuery allows some crazy manipulations) then I still want to support it.
edit: i guess i should have done the same for the rest of the url-string but the regexp would end up being almost twice as long while the TLD detect is just setting the A to uppercase- did i mention I was lazy? ^ note these (this and my previous one) does not include the co.uk or .asia etc TLDs (you guessed it, lazyness) ^ there you got those too.
iOS has things like premade ".COM" buttons and if the browser or site doesnt change it to lowercase then it will be read as ".COM" no ?
There's also the case Where Some People Like To Type Stuff Weird Like This.
when you use the "@-moz-document domain" it doesn't care if it's in lower or upper-case it accepts all variations. regexp does not unless you tell it to.
http://serverfault.com/questions/475105
https://www.ietf.org/rfc/rfc4343.txt
http://english.stackexchange.com/questions/41695
(why was I stuck on jQuery? was it because you can use it to manipulate urls to for instance mask flash-files as .jpg and scare the shit out of your friends? maybe..)
@David I worked with the regexp a bit more, this is prob the one i'll end up using
(looks like meh but it's guaranteed to match *every variation of the tpb url: *: will actually not match names such as 'thepotatoandsteakbay'