Thursday
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! Go to Solution.
Thursday - last edited Thursday
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.
Thursday - last edited Thursday
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.
yesterday
jq was, in fact, the solution.
Had to jumps through some loops to deploy it to all my macs but now it works.
Thank you!