proxytown
v0.0.5
Published
Alternate Implementation of Partytown Library with cross thread global support
Downloads
59
Maintainers
Readme
proxytown 🎉
Alternate Implementation of partytown library with automatic cross-thread global variables support.
Features
- Run third party scripts in worker thread
- Scripts can use DOM API
- Scripts can use global variables defined in main thread
- Any globals created in worker thread also usable in main thread without any config
- Scripts created and inserted by third party scripts also gets executed in worker thread
Setup
Execute below command where you want to copy the proxytown folder.
npx proxytown
Add the proxytown iframe in the html document
<iframe hidden src="path/to/proxytown/proxytown.html"> </iframe>
add type="text/proxytown"
on third party scripts that you wish to run in worker thread
<script type="text/proxytown" src="path/to/third-party-script"></script>
Example: