Page 1 of 1

Tips: Searching about:config in Toolkit-based browsers

Posted: Tue Jan 12, 2016 2:41 am
by barbaz
Just dropping some interesting & useful stuff I figured out here, because I think it might as well be posted for all to see given the way I discovered this stuff ;)
If I find more I will edit it in this post.

  • If just start typing something, it will match that string in name and value.
  • If what is typed contains a * then the * are interpreted as wildcards.
  • If search starts with a / then it MUST end with a / and what is between the /'s is interpreted as a regex. Note that just typing "//" will display ALL prefs. To literally search for "//" this is what must be typed:

    Code: Select all

    /\/\//

Re: Tips: Searching about:config in Toolkit-based browsers

Posted: Tue Jan 12, 2016 4:14 am
by Thrawn
Ah, leaning toothpick syndrome...this is why I tend to use pipeline as a sed separator.

Re: Tips: Searching about:config in Toolkit-based browsers

Posted: Tue Jan 12, 2016 2:55 pm
by therube
what is between the /'s is interpreted as a regex
Thanks, didn't know that one.
Just trying to figure what search I would use that would be different from simply chaining *'s together?

> app*upd*bac
> /app.*upd.*bac/

In particular I'm not finding a NOT & that would be helpful (the NOT not the & ;-)) ?

Re: Tips: Searching about:config in Toolkit-based browsers

Posted: Tue Jan 12, 2016 4:50 pm
by barbaz
therube wrote:In particular I'm not finding a NOT
Well in regex you can use negative lookaheads - e.g. if you want to find the string "no" NOT followed by "script"

Code: Select all

/no(?!script)/

Re: Tips: Searching about:config in Toolkit-based browsers

Posted: Tue Jan 12, 2016 11:41 pm
by Thrawn
Those two searches are the same, but regex does allow you to do more interesting things:

Code: Select all

/https?:\/\/(www\.|blah\.)?example.com/ (either protocol, choice of subdomains)
/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/ (IP address format)
/noscript[^.]/ (noscript, NOT followed by a dot)

Re: Tips: Searching about:config in Toolkit-based browsers

Posted: Sat Jan 16, 2016 7:33 pm
by therube
negative lookaheads
Guess I'll have to lookahead to get a better picture on just what lookaheads are doing ;-).
Thanks.
/noscript[^.]/ (noscript, NOT followed by a dot)
So then what is /browser[^.]/ finding (or NOT finding)?
(I know what I would expect, but what I'm seeing is not that?)

Seems the NOT'd items must not be in both the Name & Value, otherwise it is found.
(Heh. Does that make sense ;-).)

/chrome[^:]/
finds: browser.chromeURL;chrome://browser/content/
because chrome: is found in both the name & value.

Re: Tips: Searching about:config in Toolkit-based browsers

Posted: Sat Jan 16, 2016 10:58 pm
by barbaz
therube wrote:So then what is /browser[^.]/ finding (or NOT finding)?
It's finding any instance of browser followed by one character that is NOT a '.'
therube wrote:(I know what I would expect, but what I'm seeing is not that?)
It searches both name and value separately.
Also, if the pattern occurs once in a pref (name or value) with the "NOT" condition in the regex satisfied, that is enough for that pref to turn up regardless of whether the pattern is also "matched" with the "NOT" condition being violated.