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

service-workers and search params #769

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Iran-110
Copy link

Description

For advanced use of service workers, such as versioning or complex caching, we sometimes need to send data to the service worker using search parameters like /sw.js?ver=1.2.

This PR helps to solve this issue.

Linked Issues

resolves #587.

Additional Context

I use this pattern: #587 (comment)

Copy link

netlify bot commented Oct 15, 2024

Deploy Preview for vite-plugin-pwa-legacy ready!

Name Link
🔨 Latest commit b901a7f
🔍 Latest deploy log https://app.netlify.com/sites/vite-plugin-pwa-legacy/deploys/670dc3f8593d4e00087d2df9
😎 Deploy Preview https://deploy-preview-769--vite-plugin-pwa-legacy.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Iran-110 Iran-110 changed the title Sw query params service-workers and search params Oct 15, 2024
@userquin
Copy link
Member

userquin commented Oct 16, 2024

This should also work in dev mode, have you check it with some example? I'll try to review this PR next weekend (too busy, sorry )

Revert changes added to the docs, those changes should go to the docs repo here: https://github.com/vite-pwa/docs

Changes made to the examples won't pass Playwright tests (update PWA tests in the corresponding client-test folders or add an example only to some example not included in PW tests, check test script in root package.json): try running pnpm test from root folder, Playwright tests checking for the sw url in the browser page.

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

Successfully merging this pull request may close these issues.

Query Parameters on the registration URL
2 participants