partytown icon indicating copy to clipboard operation
partytown copied to clipboard

Every calls in workers seem to be triggered twice in Firefox

Open mathieuh opened this issue 2 years ago • 1 comments

In Firefox: Capture d’écran 2022-04-04 à 10 29 44

In Chrome or Safari: Capture d’écran 2022-04-04 à 10 31 32

Also, browing in private mode with Firefox seems to disable workers: "In Firefox, Service Worker APIs are also hidden and cannot be used when the user is in private browsing mode" https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API Can we handle it and how should we?

mathieuh avatar Apr 04 '22 08:04 mathieuh

hey @mathieuh - we've just created an issue template, could you update your issue here to provide all the information the template asks for? it'll help us look into your issue https://github.com/BuilderIO/partytown/issues/new?assignees=&labels=&template=bug_report.md&title=

pasting below to make things easier:


Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Reproduction link Please include a link to a Stackblitz or Codesandbox reproducing the issue. We will need to see the issue reproduced with hand-written code - we can't debug giant minified third party scripts directly. If you do not include a clean and simple reproduction of your issue, we won't be able to look into it until you do.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

steve8708 avatar May 28 '22 19:05 steve8708

I can replicate the issue in both Chromium 108 and Firefox 108. Maybe because of the double DOMContentLoaded / load listeners here: https://github.com/BuilderIO/partytown/blob/main/src/lib/main/snippet.ts#L137


Chromium:

image

Firefox:

image

ezracelli avatar Dec 22 '22 04:12 ezracelli

Closing this issue since it has become stale, or has been addressed in recent releases and docs updates. If you feel this is still an issue please reopen a new issue. Thanks.

adamdbradley avatar Mar 21 '23 15:03 adamdbradley