Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@ampproject/amp-sw
Advanced tools
A service worker library to turn your AMP pages into PWA with network resiliency.
AMP service worker is a service worker library for your AMP documents.
Purpose: Enhance network resiliency and optimize AMP asset reuse for AMP documents.
Core use cases:
stale-while-revalidate
strategy for a longer duration than the default http response headers indicate.To take advantage of AMP service worker, you'll need to host a resource loaded into the browser. Start by following these steps:
amp-install-serviceworker
(https://amp.dev/documentation/components/amp-install-serviceworker) to your AMP documents and point it your service worker file.
e.g.<amp-install-serviceworker
src="https://www.your-domain.com/serviceworker.js"
data-iframe-src="https://www.your-domain.com/install-serviceworker.html"
layout="nodisplay">
</amp-install-serviceworker>
importScripts('https://cdn.ampproject.org/sw/amp-sw.js');
AMP_SW.init();
AMP_SW.init({
assetCachingOptions: [{
regexp: /\.(png|jpg|woff2|woff|css|js)/,
cachingStrategy: 'CACHE_FIRST',
}],
offlinePageOptions: {
url: '/offline.html',
assets: [],
},
});
The AMP service worker is built up of the following modules:
link rel=prefetch
. You can use this to prefetch links and serve them from the service worker cache for the next time.While amp-sw
is divided into smaller sub modules, the core funationality of this project relies on the Workbox project. The amp-sw
modules also extend parts of the Workbox project.
FAQs
A service worker library to turn your AMP pages into PWA with network resiliency.
The npm package @ampproject/amp-sw receives a total of 36 weekly downloads. As such, @ampproject/amp-sw popularity was classified as not popular.
We found that @ampproject/amp-sw demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.