partytown
partytown copied to clipboard
[🐞] Firefox: Private Browsing for external Scripts
Describe the bug
Hey,
apparently Firefox currently doesn't support service workers in private browsing mode, so the external third party scripts aren't being called at all, but the inline scripts work without a problem. Is there a way to support the external scripts like the inline scripts as a fallback or is there no way to get it working without the service worker?
- https://bugzilla.mozilla.org/show_bug.cgi?id=1320796
Reproduction
https://github.com/sotasan/squalid-spectrum
Steps to reproduce
-
pnpm install -
pnpm build -
pnpm preview - Open http://localhost:4321 in Firefox's private browsing
Browser Info
Firefox
Additional Information
No response
I'm testing Partytown right now and spent a few hours figuring this out too.
After replacing this in the code snippet:
o=r.createElement("script")).innerHTML=l[n].innerHTML
with
o=r.createElement("script")).innerHTML=l[n].innerHTML,o.src=l[n].src
It works. I don't know anything about the project, but it may help fixing the issue.