Excluding certain sites

edited April 2013 in Style Development
Hey all.

I am completely new to coding and trying to get this to work for me has not been too fun lol. I am using this on my PC at work trough CoolNovo (Chrome). I am trying to have it include everything it does but I do not want it to include a couple of URLs

I would like to exclude the following
www.vudu.com
www.google.com
mail.google.com
portal.adp.com

I want them removed because it messes up the way they work for me and I already have other styles on google and gmail.

I would like to still have portal.vudu.com included though (its an internal site that cannot be accessed out of the domain)
the vudu portal is the important one as its the reason I installed the global theme. It will not let me just change the site its set to so I cannot do that. :/

I would really like it someone could help me get those domains excluded.

Thanks,
Nick

Comments

  • edited April 2013
    @-moz-document regexp("https?://(?!(www.vudu.com|www.google.com|mail.google.com|portal.adp.com)).*") { /* your style rules */ body{ color: pink !important; background: purple !important; } }


    if you do a forum search for "+regexp +exclude" you will find more information.
  • Thanks man, that did it for me. I can now see the buttons on vudu.com and everything is still working correctly.

  • edited April 2013
    Hi forum.
    Why other developers using backslash "\" after the "www", and before the ".com" ?
    Eg:

    @-moz-document regexp("(?!https?://(www\.giantbomb\.com|www\.youtube\.com|anothersite\.com)).*$"){

    Source: http://forum.userstyles.org/discussion/30050/
  • edited April 2013
    @-moz-document regexp("(?!https?://(www\.giantbomb\.com|www\.youtube\.com|anothersite\.com)).*$") is the more correct usage of the regexp. A backslash escapes special characters to suppress their special meaning, such as these, [\^$.|?*+(){}
    . = Special character that matches any single character
    \. = Literal character dot
    http://www.regular-expressions.info/reference.html
  • edited April 2013
    Yes, good explanation - in my defense though, I intentionally kept it as simple as possible for the user who was "completely new to coding". (still, maybe not the right thing to do)

    I'm interested to see that "\." works in Firefox just as well as "\\.", although escaping the backslash (in Firefox only) is specified in various places including Jason's instructions: Applying styles to specific sites · JasonBarnabe/stylish Wiki · GitHub. Has something changed?
  • \. is normally used in a script and \\. in css, I do believe.
  • It is true in general, but a bit complicated an fact. Few details comes into game here:
    1) CSS has a single "special" character: "\". Using "\" you can for example escape characters in selectors or write special characters out of your stylesheets code page body.\000040.with\.dot:after { content: '\0159'; } /* writes 'ř' after <body class="@ with.dot"> */.
    2) so the only way to express "\" itself in CSS is to write it as escape-codepoint (\00005C) or self-escape it (\\)
    3) there is no extra parser for regexp in CSS (like there is in Javascript), so above is in effect when writing regexp-in-plain-string in CSS @document rules, where you often want to use "\" in regexp scope for escaping other regexp-special characters (what srazzano wrote).

    http://www.w3.org/TR/CSS21/syndata.html#characters
    http://www.merttol.com/articles/code/introduction-to-css-escape-sequences.html

    I think that the fact "\." 'works' in Firefox is because it is in fact "css-escaped-dot" what produces just plain "." which is then passed to regexp. There "." matches any character. As you know, (regexp)"A.S.D" matches (string)"A.S.D" as well as (string)"AbScD". So that's why you should write (css)"regexp('https?://l\\.calh\\.st/.*')" if you want to be sure you will affect just hypothetical "l.calh.st" domain and not your "localhost".
  • Thank you, that is how it was "working".
  • edited April 2013
    Hi users.

    And if I want to exclude expressions non http-https on firefox.
    Adding other regexp line? Eg:
    @-moz-document regexp('^(?!about:newtab|about:home).*') {

    Or crazy one and only regexp line like this? Eg:
    @-moz-document regexp("(ht|f)tps?://(?!([^/]*?\\.)?wordpress\\.com/).*|file://.*|about:blank|about:neterror.*") {
    http://forum.userstyles.org/discussion/comment/68084#Comment_68084
  • edited April 2013
    The "crazy" line will accomplish exactly the result requested in that thread.

    Or you could use:
    @-moz-document regexp("https?://(?!([^/]*?\\.)?wordpress\\.com/).*"),
    url-prefix(ftp://),
    url-prefix(file://),
    url(about:blank),
    url-prefix("about:neterror")
    {
    which I think is clearer but does (almost) the same thing.
    Each expression actually includes things - the regexp includes all http and https sites except wordpress.com. That's why you can't exclude anything by adding another regexp expression

    if you want to exclude ftp://[*.]wordpress.com, you would change that line (url-prefix(ftp://)) to only include all ftp except wordpress.com (which requires a regexp):
    @-moz-document regexp("https?://(?!([^/]*?\\.)?wordpress\\.com/).*"),
    regexp("ftps?://(?!([^/]*?\\.)?wordpress\\.com/).*"),
    url-prefix(file://),
    url(about:blank),
    url-prefix("about:neterror")
    {
    I think this does exactly what the single regexp rule (provided by grom) does.

    If I've made any errors I hope the more knowledgeable people here will let us know.
  • edited October 2013
    Hi forum.

    But, to exclude 'about pages', Do single regexp lines work better for that??:
    @-moz-document regexp('^(?!about:newtab).*') {

    Or, How Can I exclude some 'about pages' inside this?:
    @-moz-document regexp("https?://(?!(www.your.sites.here.com|forum.example.com)).*"), url-prefix(ftp://), url-prefix(about), url-prefix(javascript)

  • edited October 2013
    EpamiTut, so which is it? Do you want to exclude about:newtab, or prevent white flashes while pages are loading? To exclude newtab, try:
    @-moz-document regexp("about:(?!newtab).*|ftp://.*|javascript.*|https?://(?!www.your.sites.here.com|forum.example.com).*") {
    To prevent white flashes: http://forum.userstyles.org/discussion/comment/80974#Comment_80974
  • edited October 2013
    Yes, to Exclude some "about:" pages.
    That line works nice, I see this don't lose the 'global style names' from Stylish icon, when the user visites about: pages.

    Doesn't "?!" need parenthesis( before excluded websites ? and one more ) after last excluded site?

    Also, Is not necessary the line?:
    @-moz-document url-prefix(ftp://), url-prefix(about), url-prefix(javascript)
    Oh. I need to include file:// pages.
    Ok: after last ")" inside regexp line, I can adding--> , url-prefix(file://)

    Testing: Global dark style - changes everything to dark.

  • You have to seen easily here latest function of unscramble words free game have to start full fun forever to join it
Sign In or Register to comment.