Skip to content

Instantly share code, notes, and snippets.

@bradenbest
Last active March 30, 2018 10:04
Show Gist options
  • Save bradenbest/00a946dcbbaedeb2f5f40498a01e1b2d to your computer and use it in GitHub Desktop.
Save bradenbest/00a946dcbbaedeb2f5f40498a01e1b2d to your computer and use it in GitHub Desktop.
[linux] How to add flash to Firefox (in 2018)
View raw

(Sorry about that, but we can’t show files that are this big right now.)

This file has been truncated, but you can view the full file.
View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

@bradenbest
Copy link
Author

bradenbest commented Mar 30, 2018

Here's a script:

cd .mozilla
mkdir -p plugins
curl https://gist.githubusercontent.com/bradenbest/00a946dcbbaedeb2f5f40498a01e1b2d/raw/d961cd0c17f89433e4e2f01aace7418163354d29/libflashplayer.so.bz2 | bunzip2 -c > plugins/libflashplayer.so
curl https://gist.githubusercontent.com/bradenbest/00a946dcbbaedeb2f5f40498a01e1b2d/raw/d961cd0c17f89433e4e2f01aace7418163354d29/pluginreg-insert > /tmp/prinsert
ed firefox/*.default/pluginreg.dat <<< $'/PLUGIN/r /tmp/prinsert\nwq'
rm /tmp/prinsert
echo "Flash should be installed now."

it...

  • Creates the .mozilla/plugins directory if it doesn't already exist
  • Downloads libflashplayer.so.bz2, runs it through bunzip2, and outputs it in plugins/libflashplayer.so
  • Downloads the text to be inserted into pluginreg.dat and saves it as /tmp/prinsert
  • Uses ed (the standard editor) to automatically insert that file inside pluginreg.dat.
  • Cleans up after itself

It needs these programs to run:

  • bash (the shell you'll be running the script in)
  • curl
  • bzip2
  • ed
  • mkdir
  • rm

You can see whether you have a given command with which, e.g.:

$ which curl

Although if you don't have ed, mkdir or rm for some reason, then you won't have which either, cause your system is broken.

Update

I've tested the script and it works.

Went from a fresh, empty .mozilla directory (tar cf moz.tar .mozilla to backup) that tried to download the SWF, to being able to run the SWF directly, using only the lines in the above script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment