Skip to content

Instantly share code, notes, and snippets.

@v3l0c1r4pt0r
Created January 26, 2015 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save v3l0c1r4pt0r/bdebdc586dc28d325a83 to your computer and use it in GitHub Desktop.
Save v3l0c1r4pt0r/bdebdc586dc28d325a83 to your computer and use it in GitHub Desktop.
Simple script to force Firefox to open SWF files
#!/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