Comments (4)
和普通sw卸载方式一样:
1.不要删除cw.js
2.将安装代码替换为卸载代码
from clientworker.
请问卸载代码是啥?现在在我网站里面关不掉了,安装也安不上,关也关不掉 :(
from clientworker.
请问卸载代码是啥?现在在我网站里面关不掉了,安装也安不上,关也关不掉 :(
...这东西不应该在本地测试好在上生产吗...
移除cw和移除sw一样,请不要直接删掉cw.js和安装代码,如果已删除请将原文件复原,并将安装代码改成:
navigator.serviceWorker.getRegistrations().then(function(registrations) {
for(let registration of registrations) {
registration.unregister()
} })
在足够长的一段时间后才能移除js文件,否则很有可能有一部分访客没能获得卸载代码导致无法卸载也无法更新。
from clientworker.
请问卸载代码是啥?现在在我网站里面关不掉了,安装也安不上,关也关不掉 :(
...这东西不应该在本地测试好在上生产吗...
移除cw和移除sw一样,请不要直接删掉cw.js和安装代码,如果已删除请将原文件复原,并将安装代码改成:
navigator.serviceWorker.getRegistrations().then(function(registrations) { for(let registration of registrations) { registration.unregister() } })
在足够长的一段时间后才能移除js文件,否则很有可能有一部分访客没能获得卸载代码导致无法卸载也无法更新。
好的,谢谢😃
from clientworker.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clientworker.