最近,我已经在本地开发聚合物,它使用服务工作者的离线功能。
每次使用高分子之后,我都会通过控制台运行一个应用程序,我会收到与sw-imports.js相关的错误消息。当使用rails应用程序时,这尤其令人讨厌,因为它会污染终端输出。
错误信息是:
Started GET "/sw-import.js?baseURI=http%3A%2F%2Flocalhost%3A3000%2Fbower_components%2Fplatinum-sw%2Fplatinum-sw-register.html&clientsClaim=true&defaultCacheStrategy=networkFirst&importscript=http%3A%2F%2Flocalhost%3A3000%2Fbower_components%2Fplatinum-sw%2Fbootstrap%2Fsw-toolbox-setup.js&importscriptLate=http%3A%2F%2Flocalhost%3A3000%2Fbower_components%2Fplatinum-sw%2Fbootstrap%2Fsw-toolbox-setup.js&precache=&skipWaiting=true&version=1.0" for ::1 at 2015-12-05 16:14:46 +0000
ActionController::RoutingError (No route matches [GET] "/sw-import.js"):控制台消息的完整粘贴是这里。
我已经在浏览器中访问了chrome://inspect/#service-workers,并删除了其中列出的所有服务工作人员,但我仍然得到相同的控制台错误。
知道如何从我的环境中完全删除对sw-imports.js的调用吗?
编辑:确认,这是发生在非聚合物项目,其中没有涉及铂-sw元素。
发布于 2015-12-05 22:27:27
我认为您必须避免通过platinum-sw元素使用服务工作。它要求文件存在:https://github.com/PolymerElements/platinum-sw#top-level-sw-importjs
一旦你为一个特定的网站注册了一名服务人员,显然你必须手动注销它。在Chrome上,你可以在chrome://serviceworker-内部设备/
https://stackoverflow.com/questions/34107810
复制相似问题