You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add inject_scripts option
This option enables injecting custom scripts from static/ into replayed pages in both the client-side and server-side replay modes. This is useful for emulating removed browser features (such as emulating Flash Player with Ruffle) or applying compatibility or behavior tweaks.
* Supports injecting scripts in both server-side and client-side replay
* Supports injecting scripts globally and per collection, eg:
```
inject_scripts:
- all.js
- ruffle.js
collections:
mycoll:
inject_scripts:
- all.js # static/all.js
- _/mycoll/tweaks.js # collections/mycoll/static/tweaks.js
```
Co-authored-by: Tessa Walsh <[email protected]>
Co-authored-by: Lauren Ko <[email protected]>
Copy file name to clipboardExpand all lines: docs/manual/configuring.rst
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -655,3 +655,30 @@ By default, SSL-Certificates of websites are not verified. To enable verificatio
655
655
656
656
``ca_cert_dir`` can optionally point to a directory containing the CA certificates that you trust. Most linux distributions provide CA certificates via a package called ``ca-certificates``.
657
657
If omitted, the default system CA used by Python is used.
658
+
659
+
Injecting Scripts
660
+
-----------------
661
+
662
+
Extra JavaScript files can be injected into replayed pages. This can be useful for emulating removed browser features
663
+
or applying compatibility tweaks.
664
+
665
+
For example, to emulate Flash Player using `Ruffle <https://ruffle.rs/>`_, create a subdirectory named ``static/ruffle``
666
+
and unzip the `Ruffle self-hosted package <https://ruffle.rs/downloads#website-package>`_ into it. Then add the following
667
+
configuration::
668
+
669
+
inject_scripts:
670
+
- ruffle/ruffle.js
671
+
672
+
Note: Paths listed under ``inject_scripts`` are relative to the ``static_dir`` directory (default ``static/``).
673
+
674
+
Injected scripts can also be configured per collection::
0 commit comments