How to set @-moz-document for every page but not .html ones?


I need to set @-moz-document working on every page but not ending ".html". For example:

Is it possible? I tried to use regexp method but without expected results.

Anyone could help me?


  • Select URLs matching the regexp with negative look-ahead: .*(?!\.html).{5}

    Or as a moz-format for classic Stylish:

    @-moz-document regexp(".*(?!\\.html).{5}") {
  • edited October 2017 Firefox

    The .{5] looks a bit hacky to me but should work (the .* matches the whole address up to .htm but not .html)

    I didn't test if it works, but .*(?>!\.html)$ looks a bit cleaner to me. But it uses negative lookbehind which may not be supported.

    Or maybe using the non-greedy quantifier .*?(?>!\.html)$?

    Actually more information leads to a better RegEx. Should match or not?

    RegEx is always nice to learn and discuss :-)

Sign In or Register to comment.