Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
astrojs-service-worker
Advanced tools
An Astro integration that generates a Service Worker. Powered by Workbox.
An Astro integration that generates a Service Worker. Powered by Workbox.
A minimal wrapper around Workbox to quickly add a service worker to your Astro static site. Get precached pages and offline support out of the box.
npm install astrojs-service-worker
or yarn add astrojs-service-worker
astrojs-service-worker
to your astro.config.mjs integrations:import { defineConfig } from "astro/config";
+ import serviceWorker from "astrojs-service-worker";
export default defineConfig({
+ integrations: [serviceWorker()],
});
Note that in local development a no-op service worker is generated, otherwise service workers interfere with hot module reloading (because they intercept the request for the updated asset).
Name | Description | Type |
---|---|---|
enableInDevelopment |
Enable the service worker in local development. The service worker's precaching of static files will prevent hot module reloading during development. If Defaults to | boolean | undefined |
registration.autoRegister |
Autoregister the service worker. If
Defaults to | boolean | undefined |
workbox |
Options passed to `worbox-build`. See all available configuration options [here](https://developer.chrome.com/docs/workbox/modules/workbox-build/)
Defaults to Note: | InjectManifestOptions | GenerateSWOptions |
You must serve your application over HTTPS in production environments. Service Workers must be served from the site's origin over HTTPS.
Some browsers special case localhost
, so this is may not necessary during local development. HTTPS is not handled by this library.
The service worker origin constraint means that service workers can not control pages on a different subdomain. Eg mysite.com
can not be controlled by a service worker if that was served from a subdomain such as mycdn.mysite.com
.
PR's and issues welcomed! For more guidance check out CONTRIBUTING.md
See the project's MIT License.
FAQs
An Astro integration that generates a Service Worker. Powered by Workbox.
The npm package astrojs-service-worker receives a total of 1,170 weekly downloads. As such, astrojs-service-worker popularity was classified as popular.
We found that astrojs-service-worker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.