Skip to content

Commit

Permalink
Update injectScripts patching
Browse files Browse the repository at this point in the history
  • Loading branch information
wvengen committed Mar 14, 2024
1 parent 58b259e commit da730f9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ RUN mkdir /app && \
rm -Rf node_modules && \
rm -Rf index.js src assets package.json README.md

# modify service worker to add injection script
RUN sed -i 's/\(injectScripts:\s*\[\)/\1"inject.js",/' /app/sw.js
# modify service worker to add injection script (old and new)
RUN sed -i 's/\(injectScripts:\s*\[\)/\1"inject.js",/' /app/sw.js && \
sed -i 's/\(t\.set(\s*"injectScripts"\s*,\s*"ruffle\/ruffle.js"\s*)\s*,\)/\1t.append("injectScripts","inject.js"),/' /app/ui.js
# workaround for https://github.com/webrecorder/wabac.js/issues/105
RUN sed -i 's/if\s*(\s*!\s*\([a-zA-Z_]\+\)\(\.length)\s*return[^)]\+size of the file is not accessible\)/if(\1.canLoadOnDemand\&\&!\1\2/' /app/sw.js

Expand Down

0 comments on commit da730f9

Please sign in to comment.