Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tawk.to issue/navigator.plugins undefined #270

Closed
1 task
edde746 opened this issue Oct 1, 2022 · 6 comments
Closed
1 task

Tawk.to issue/navigator.plugins undefined #270

edde746 opened this issue Oct 1, 2022 · 6 comments

Comments

@edde746
Copy link

edde746 commented Oct 1, 2022

  • I am interested in helping provide a fix!

Describe the bug
navigator.plugins is undefined causing the script not to load

To Reproduce
See repl, check console

Expected behavior
Script should load without error

Partytown version
Latest?

Screenshots
Error

Additional context
Seems like the issue is that navigator.plugins isn't available in the service worker.

@itxch
Copy link
Contributor

itxch commented Oct 2, 2022

Seems like the issue stems from the fact that navigator is created based on WebWorkerNavigator, not window.navigator.
So it only has these methods: https://developer.mozilla.org/en-US/docs/Web/API/WorkerNavigator
For other methods - such as navigator.plugins it'd probably need a custom implementation

@vip30
Copy link

vip30 commented Jan 20, 2023

The same issue happens in chartbeat_video.js

@solamichealolawale
Copy link

What's the update on this? Are we suppose to load in the main thread?

@anhle82
Copy link

anhle82 commented Apr 13, 2023

I have similar issue with tawk to as well as another 3rd party script that requires navigator.vendor. Has anyone figured out how to solve this navigator issue for web worker?

@cornedor
Copy link
Contributor

cornedor commented Oct 17, 2023

I'm not sure what Tawk is using plugins for, but as a workaround I've added this line to the Tawk snippet:

window.navigator.plugins = window.navigator.pdfViewerEnabled ? ['PDF Viewer'] : [];

This seems to be the only usecase of navigator.plugins: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/plugins

@gioboa
Copy link
Member

gioboa commented Jan 24, 2024

Closed by #539

@gioboa gioboa closed this as completed Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants