This is basically just a simplified version of @chaos's approach:
grep -oP '},"name":"\K[^"]*' ~/.mozilla/firefox/*.default/addons.json
There's no reason to get the name of the user, you can always just use
$HOME to get the home directory. The name of the default profile is, likewise, unneeded. You probably only have one and its name will be
RandomString.default. If you have more than one, and different addons for each, this approach will list all of them. So, if you do have multiple profiles, you might want to add
| uniq to the above command to remove duplicates.
grep -oP : the
grep to only print the matched portion of the line and the
-P activates Perl Compatible Regular Expressions which are needed for the
\K (see below).
},"name":"\K[^"]*: match the longest stretch of non-
" characters (
[^"]*) that come right after
\K means "ignore everything matched up to here" which, when combined with
-o, will cause only the part of the match after the
name:":" to be printed.
~/ : this is your home directory.