Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@dreamworld/workbox-installer
Advanced tools
Readme
A helper library to install a Service Worker generated using Workbox into/for PWA(Progressive Web App).
service-worker.js
using workbox, and set clientsClaim=true & skipWaiting=false
options. You would like to configure other options for your PWA as shown in this demo. Feel free to chose your preferred way of the build.npm install --save workbox-installer
import { default as installWorkbox } from '@dreamworld/workbox-installer';
installWorkbox('/service-worker.js');
User won't see any notification about the new version available. But, This will ensure that the user will get the latest version of the App (service-worker) installed/updated on the page reload (or on the next visit).
Though, It’s side effect is that, when the app is opened in the 2nd browser tab, it is updated automatically; unwantedly.
If you want to show your users a notification when a new version is available. And want to update the App only after user confirms update. Then register a confirmUpdate
handler function too.
installWorkbox({
url: '/service-worker.js',
confirmUpdate: () => {
//Create a Promise & return it.
//Show notification to your user
//When user confirms, resolve the promise.
}
});
In the above methods, whether a new version of the service-worker is available or not, is checked only on the page reload. But, if you want to customize the update checking process, e.g. Listen on the firebase realtime database changes and show a notification to the user as soon as the new version is released. Then, you need to provide UpdateChecker
.
Example usage:
installWorkbox({
url: '/service-worker.js',
confirmUpdate: (updates) => {
//Here, `updates` is the updates notified by the `UpdateChecker` you provided.
//Create a Promise & return it.
//Show notification to your user
//When user confirms, resolve the promise.
},
updateChecker: yourUpdateChecker
});
Following implementations of the UpdateChecker
are available, check them if you can use one of them. Otherwise, you can always provide your custom implementation as per your requirement.
FAQs
A helper library to install a Service Worker generated using [Workbox][workbox] into/for PWA(Progressive Web App).
The npm package @dreamworld/workbox-installer receives a total of 83 weekly downloads. As such, @dreamworld/workbox-installer popularity was classified as not popular.
We found that @dreamworld/workbox-installer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.