Regex excluding [about:] pages in firefox

0

I'm trying to get stylish style sheet to be deactivated on about: pages. I believe the regular expression below should be able to do just that, but firefox seems to be of a different opinion. Could someone point me in the right direction please?

@-moz-document regexp("(^(?=(?!about))){1}.*")

Anne

Posted 2015-05-27T11:56:50.227

Reputation: 1

Answers

0

One possibility is

@-moz-document regexp("^a?!(bout:).*|^[^a].*")

However, testing your regex, it works for me in any case. Are you enclosing the rest of the script in braces afterwards?

@-moz-document regexp("(^(?=(?!about))){1}.*") {
    /* rest of script */
}

If so, you might have the wrong idea about what the about: url is matching. This only matches the page contents of about: pages. Note that any Firefox UI elements that are affected by your style will still be affected (even when you're visiting an about: page).

As an aside, it's convenient to use a simple userstyle like this for testing, so your script's behaviour won't complicate things when testing the regex.

pyrocrasty

Posted 2015-05-27T11:56:50.227

Reputation: 1 332