Skip to content

Instantly share code, notes, and snippets.

@reasonableperson
Last active December 22, 2018 10:09
Show Gist options
  • Save reasonableperson/5c92fbafa3b8681d04aa94ddc2355113 to your computer and use it in GitHub Desktop.
Save reasonableperson/5c92fbafa3b8681d04aa94ddc2355113 to your computer and use it in GitHub Desktop.
Patch for foo_beefweb-0.3.fb2k-component so it works in iOS Safari
# Paste this into your shell in the same directory as foo_beefweb-0.3.fb2k-component.
# This script will create foo_beefweb-0.3.patched.fb2k-component, which you can then
# install in the foobar2000 GUI.
# The patch allows you to change tracks by clicking as well as double- clicking. This
# isn't the best on a desktop, but since double-clicking is broken in iOS Safari,
# something like this is needed to be able to change tracks.
unzip foo_beefweb-0.3.fb2k-component beefweb.root/bundle.js;
printf "\ndocument.addEventListener('DOMContentLoaded', _ => {\
var dc = document.createEvent('MouseEvents'); dc.initEvent('dblclick', true, true); \
document.getElementById('dtable-id0').addEventListener('click', e => \
{e.target.dispatchEvent(dc)})});" >> beefweb.root/bundle.js;
cp foo_beefweb-0.3.fb2k-component foo_beefweb-0.3.patched.fb2k-component;
zip foo_beefweb-0.3.patched.fb2k-component beefweb.root/bundle.js;
rm beefweb.root/bundle.js && rmdir beefweb.root;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment