Recently I've been trying to extract infos of which extensions our users have on their browsers.
I have a script running for our major browsers and it's working great but now I'd like to get more infos that are sealed inside a .json file.
Is there a way to extract specific lines from a .json file such as the "manifest.json" you can find in every Chrome extension's folder?
Specifically I need only the rows talking about which permission does the extension have as seen below.
Solved
Extracting infos from a .json file
Best answer by karthikeyan_mac
Hi @DonCascone
You can use jq to extract and print the permissions or grep & sed. Please test it. I am not expert :)
jq -c '.permissions' manifest.json
or
grep '"permissions"' manifest.json | head -1 | sed -E 's/.*"permissions":\\s*\\[([^]]*)\\].*/[\\1]/'
Thanks.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
