Created
March 14, 2020 01:57
-
-
Save MarkWalters-dev/a9a4d94c43db09f5292fef87b74034b4 to your computer and use it in GitHub Desktop.
Download chrome extension and extract it
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# pip has 2 options for downloading chrome extensions. cedl and chrome-webstore-download | |
# cedl has a more recent update than chrome-webstore-download | |
# but cedl polutes ~/bin by downloading to ~/bin/chrome-extensions so it is not an option without fixing that anti-feature | |
# chrome-webstore-download downloads to the current directory but requires -u|--url which is annoying but has the | |
# option to save to a custom filename with -f|--file which could come in handy | |
# | |
# This little script uses chrome-webstore-download to download and extract a chrome extension | |
# | |
# Example: crxdl https://chrome.google.com/webstore/detail/allow-cors-access-control/lhobafahddgcelffkeicbaginigeejlf | |
hash chrome-webstore-download 2>/dev/null || pip install chrome-webstore-download | |
result=`chrome-webstore-download -u "$1"` || exit 1 | |
resulttmp=${result/Downloading } | |
filename=${resulttmp/. *} | |
dir=${filename%%.crx} | |
unzip -o $filename -d $dir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment