partytown icon indicating copy to clipboard operation
partytown copied to clipboard

[🐞] Firefox: Private Browsing for external Scripts

Open sotasan opened this issue 1 year ago • 1 comments

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

  1. pnpm install
  2. pnpm build
  3. pnpm preview
  4. Open http://localhost:4321 in Firefox's private browsing

Browser Info

Firefox

Additional Information

No response

sotasan avatar Apr 11 '24 11:04 sotasan

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.

kuraobi avatar Apr 26 '24 18:04 kuraobi