Git Product home page Git Product logo

Comments (4)

ChenYFan avatar ChenYFan commented on June 23, 2024

和普通sw卸载方式一样:
1.不要删除cw.js
2.将安装代码替换为卸载代码

from clientworker.

1834423612 avatar 1834423612 commented on June 23, 2024

请问卸载代码是啥?现在在我网站里面关不掉了,安装也安不上,关也关不掉 :(

from clientworker.

ChenYFan avatar ChenYFan commented on June 23, 2024

请问卸载代码是啥?现在在我网站里面关不掉了,安装也安不上,关也关不掉 :(

...这东西不应该在本地测试好在上生产吗...

移除cw和移除sw一样,请不要直接删掉cw.js和安装代码,如果已删除请将原文件复原,并将安装代码改成:

navigator.serviceWorker.getRegistrations().then(function(registrations) {
 for(let registration of registrations) {
  registration.unregister()
} })

在足够长的一段时间后才能移除js文件,否则很有可能有一部分访客没能获得卸载代码导致无法卸载也无法更新。

from clientworker.

1834423612 avatar 1834423612 commented on June 23, 2024

请问卸载代码是啥?现在在我网站里面关不掉了,安装也安不上,关也关不掉 :(

...这东西不应该在本地测试好在上生产吗...

移除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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.