Created
January 26, 2015 19:59
-
-
Save v3l0c1r4pt0r/bdebdc586dc28d325a83 to your computer and use it in GitHub Desktop.
Simple script to force Firefox to open SWF files
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
#!/bin/sh | |
#bash script to force firefox to open SWF files | |
if [ $# -lt 1 ]; | |
then | |
echo "usage: $0 [filename]" | |
exit 1; | |
fi; | |
outfile="/tmp/swf.html" | |
if [[ $1 =~ /.* ]]; | |
then | |
#it already starts with / so do nothing | |
file=$1 | |
else | |
#append name to CWD | |
file=$(pwd)/$1 | |
fi; | |
cat > $outfile << EOF | |
<html> | |
<head /> | |
<body style="margin:0;"> | |
<object type="application/x-shockwave-flash" data="$file" | |
style="width:100%;height:100%;"> | |
<param name="movie" value="$file" /> | |
<param name="allowfullscreen" value="true" /> | |
<param name="allowscriptaccess" value="always" /> | |
<param name="wmode" value="opaque" /> | |
<param name="quality" value="high" /> | |
<param name="menu" value="false" /> | |
</object> | |
</body> | |
</html> | |
EOF | |
firefox $outfile &>/dev/null & | |
state=$? | |
#wait 10 seconds then clean | |
sleep 10 | |
rm $outfile | |
exit $state |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment