Comments (4)
However, accessing dataLayer properties like functions, objects, etc... from the main thread is not intended. For example, DataLayer is an array filled by our functions inside the partytown's worker, but we can't access these data from the main thread. Some other third-party scripts depend on these data stored into datalayer, and these third parties work in another thread.
Would you be able to create simplified example of this? Maybe even just an index.html file with an inlined script?
from partytown.
Thanks for the reply. More accurately, I want to access some data of dataLayer from the main thread, created and filled inside partytown's worker. Actually, it is about creating communication between partytown's workers and the main thread. You already have messaging events. After every data change, partytown sends serialized data to the main thread. We can write our handler and catch these data, but I am searching for a more straightforward solution if possible, such as using forward
prop, etc...
However, accessing dataLayer properties like functions, objects, etc... from the main thread is not intended. For example, DataLayer is an array filled by our functions inside the partytown's worker, but we can't access these data from the main thread. Some other third-party scripts depend on these data stored into datalayer, and these third parties work in another thread.
If you need an assist to clarify the situation, I can gladly help.
from partytown.
Thanks for the tip about dataLayer Inspector+, I'll start using that too.
Which dataLayer properties do you want to access from the main thread? If you can help me define what it needs to do we can work out some tests and update the code to make sure we can cover all the cases, or at least try. Thanks.
from partytown.
Is there already a solution for this? I have exactly the same problem.I want to update variables from the web worker in the main thread
from partytown.
Related Issues (20)
- [🐞] resolveUrl function in partytown config does not work HOT 2
- [🐞] Error 404 for '/_next/static/%7Epartytown/proxytown' and some iOS/Safari versions HOT 4
- [🐞] Web Worker Does Not Allow `withCredentials` for XHR Requests
- [🐞] Google Tag Assistant Preview is not showing tags (Google Tag Manager) while using Partytown HOT 1
- [📖] How can I load partytown from a pure HTML/JS website? HOT 1
- [🐞]partytown throws error in chrome developer console and not able to connect to GTM preview mode HOT 13
- [🐞]404 errror throws while implementing partytown in gatsby application HOT 3
- Failed to register a ServiceWorker for scope ('https://example/~partytown/') with script ('https://example.com/~partytown/partytown-sw.js'): The script resource is behind a redirect, which is disallowed. HOT 1
- Partytown integration with Astro makes over 10'000 proxytown requests on page load[🐞] HOT 2
- [🐞] Google Tag Manager NextJS forward events coming as blank []
- [🐞] Cannot read property 'Error' of null
- [🐞] Proxy object could not be cloned HOT 1
- [🐞] Firefox: 404 partytown-sandbox-sw.html HOT 1
- [🐞] Firefox: Private Browsing for external Scripts HOT 1
- [🐞] GA4 sessions plummeted after migration of GTM to Partytown HOT 11
- [🐞] Objects and object properties can't be forwarded HOT 2
- [🐞]in statement is not reliable when running through partytown
- [📖] resolveSendBeaconRequestParameters missing in docs and React types HOT 1
- [🐞]: forwarding gtm dataLayer.push breaks immediate dataLayer pushes HOT 3
- [🐞] page_view and on_load events are not firing in GA4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from partytown.