Alternate Implementation of partytown library with automatic cross-thread global variables support
Run third-party scripts in the worker thread 🥳
- third party scripts can still use DOM API and global variables defined in the main thread automatically.
- Any globals created in the worker thread are also usable in the main thread automatically.
- scripts created and inserted by third-party scripts get executed in the worker thread automatically.
- Lightweight (6KB for all files combined)
Get the Proxytown folder from proxytown-download.pages.dev
(specify either a specific version or go for the latest)
Move this folder in your project, and use the the Proxytown iframe in your page
<iframe hidden src="path/to/proxytown/proxytown.html"> </iframe>
Set type="text/proxytown"
on third-party scripts that you wish to run in Proxytown's worker thread
<script type="text/proxytown" src="path/to/third-party-script"></script>
Checkout this sandbox for example
It's still in development 🛠