Tips: Searching about:config in Toolkit-based browsers

General discussion about web technology.
Post Reply
barbaz
Senior Member
Posts: 9173
Joined: Sat Aug 03, 2013 5:45 pm

Tips: Searching about:config in Toolkit-based browsers

Post by barbaz » Tue Jan 12, 2016 2:41 am

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

    /\/\//
*Always* check the changelogs BEFORE updating that important software!
-

User avatar
Thrawn
Senior Member
Posts: 3106
Joined: Mon Jan 16, 2012 3:46 am
Location: Australia
Contact:

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

Post by Thrawn » Tue Jan 12, 2016 4:14 am

Ah, leaning toothpick syndrome...this is why I tend to use pipeline as a sed separator.
======
Thrawn
------------
Religion is not the opium of the masses. Daily life is the opium of the masses.

True religion, which dares to acknowledge death and challenge the way we live, is an attempt to wake up.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

User avatar
therube
Ambassador
Posts: 7421
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

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

Post by therube » Tue Jan 12, 2016 2:55 pm

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 & ;-)) ?
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 5.1; rv:42.0) Gecko/20100101 SeaMonkey/2.39

barbaz
Senior Member
Posts: 9173
Joined: Sat Aug 03, 2013 5:45 pm

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

Post by barbaz » Tue Jan 12, 2016 4:50 pm

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)/
*Always* check the changelogs BEFORE updating that important software!
-

User avatar
Thrawn
Senior Member
Posts: 3106
Joined: Mon Jan 16, 2012 3:46 am
Location: Australia
Contact:

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

Post by Thrawn » Tue Jan 12, 2016 11:41 pm

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)
======
Thrawn
------------
Religion is not the opium of the masses. Daily life is the opium of the masses.

True religion, which dares to acknowledge death and challenge the way we live, is an attempt to wake up.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

User avatar
therube
Ambassador
Posts: 7421
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

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

Post by therube » Sat Jan 16, 2016 7:33 pm

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.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0 SeaMonkey/2.39

barbaz
Senior Member
Posts: 9173
Joined: Sat Aug 03, 2013 5:45 pm

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

Post by barbaz » Sat Jan 16, 2016 10:58 pm

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.
*Always* check the changelogs BEFORE updating that important software!
-

Post Reply