BuilderIO / partytown

Relocate resource intensive third-party scripts off of the main thread and into a web worker. 🎉

Home Page:https://partytown.builder.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inspecting custom objects that are forwarded

seand52 opened this issue · comments

commented

Hi,

I have a script loaded with partytown that adds an object to the window, for example this is a simple implementation:

<script type="text/partytown">
window['customObject']={data: 'hello world'}
</script>

In my partytown configuration I'm forwarding the customObject to the main thread like this:

forward: ['customObject']

When I do a console log of window['customObject] in the main thread I can see this is a function such as (...args) => forwardCall(arr, args). I'm wondering if it's possible to check the value of customObject.data from the main thread console log?

commented

same question