NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
This script intercepts Web Audio contexts and shows a pop-up window to enable autoplay, allowing you to play Web games on iOS with sound that are otherwise incompatible. Background audio autoplay is disallowed on iOS, users are not even allowed to add exceptions. Thus, many existing Web apps, games, WebAssembly apps in particular, are incompatible with iOS without modifications.
Note: by default, this script matches ALL websites, since the iOS "Userscript" extension has no way to apply scripts to user-defined websites. Thus, make sure to enable this script only when it's needed, and disable it otherwise.
For more information, please check the blog post Force Enable Web Audio Autoplay on iOS for Incompatible Apps via Userscript.
The following three emulators had no audio due to aforementioned compatibility problem,
which is successfully fixed by my Userscript.
PC-98 emulation by a WebAssembly port of DOSBox-X via Emscripten, by yksoft1,
running the game Touhou 4: 東方幻想郷 ~ Lotus Land Story
NES emulation by Pinky, an NES emulator written in Rust, running the game Super Mario Bros..
IBM PC emulation by PCjs, a JavaScript emulator of IBM PC and compatibles, running the game Nine Princes in Amber
This Userscript doesn't always work due to several limitations.
First, even with @run-at document-start
, technical limitations on iOS make it
impossible to run Userscript exactly before everything else. If the Web pages
creates an AudioContext
at an very-early moment (e.g. in a JavaScript file
that runs as soon as the page is loaded), this AudioContext
cannot be
intercepted.
Next, background audio can be implemented via methods other than Web Audio'sAudioContext
. This script makes no attempt to patch them.
Use Safari to open my script Unblock iOS Background WebAudio hosted on OpenUserJS, click "Install". Now the source code of the script should appear on the
screen. You may use this chance review the code to see how it works.
Click the "puzzle" icon at the right of the address bar to open
the list of browser extensions, click "Userscript", and grant permissions.
Note: By default, this script matches ALL websites, since the iOS "Userscript" extension has no way to apply scripts to user-defined websites. Thus, make sure to enable this script only when it's needed, and disable it otherwise.
Rating: 0