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
Many third-party scripts are initialising global objects allowing to use its methods and properties (e.g. AppcuesBundleSettings.accountId).
Unfortunately object or non-functional object property can't be forwarded it seems.
Example of object:
const Foo {
id: '123',
func: () => {}
}
So Foo.func can be forwarded and used, while Foo.id isn't accessible.
Tried to set it in all the following ways with no luck (either returns 'undefined' or function definition from partytown):
@mdrmtz Can you give an example of a custom event usage for this?
Do you mean calling window.postMessage from a loaded via partytown script and send an object inside?
Using loadScriptsOnMainThread isn't an option really when we can just not use partytown for it. It is more like a workaround when we want a tag script being called via partytown while the loaded script on the main thread. Not sure how much optimisation it provides.
Describe the bug
Many third-party scripts are initialising global objects allowing to use its methods and properties (e.g.
AppcuesBundleSettings.accountId
).Unfortunately object or non-functional object property can't be forwarded it seems.
Example of object:
So
Foo.func
can be forwarded and used, whileFoo.id
isn't accessible.Tried to set it in all the following ways with no luck (either returns 'undefined' or function definition from partytown):
Reproduction
https://82qcgq-5000.csb.app/
Steps to reproduce
Browser Info
Any
Additional Information
Feel free to convert to an Improvement if there is no any workaround
The text was updated successfully, but these errors were encountered: