Adds help and checks url is given
This commit is contained in:
parent
f0404cd7fc
commit
045a120083
1 changed files with 19 additions and 0 deletions
|
@ -1,10 +1,27 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
|
||||
cat << 'EOF'
|
||||
Usage: clickjacking url [outfile]
|
||||
|
||||
The script will use a headless version of firefox to screenshot a page containing the provided url in an iframe
|
||||
|
||||
You will need to create a profile called headless for firefox before this will work.
|
||||
|
||||
Open firefox and go to about:profiles to create one
|
||||
EOF
|
||||
exit 0
|
||||
fi
|
||||
# Name of firefox binary
|
||||
firefox="firefox"
|
||||
# If firefox developer edition is installed, use that instead
|
||||
type "firefox-developer-edition" 2>&1 >/dev/null && firefox="firefox-developer-edition"
|
||||
|
||||
die(){
|
||||
echo "$@"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Name of firefox profile to use
|
||||
# This will need to be a profile that isn't currently open
|
||||
# I suggest making one for headless use
|
||||
|
@ -14,6 +31,8 @@ profile="headless"
|
|||
# Url of site to put in iframe
|
||||
url="$1"
|
||||
|
||||
[ -z "$url" ] && die "You need to provide a url"
|
||||
|
||||
# Name of image to make
|
||||
output="${2:-screenshot.png}"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue