i built phonegap app using polymer but while application is started and i debugged it in chrome i seen following error in console.
Uncaught (in promise) DOMException: Failed to register a ServiceWorker: The URL protocol of the current origin ('file://') is not supported.
Anyone know how to use service worker with file:// origin?
答案 0 :(得分:0)
出于安全考虑,我认为你不能。
相反,您需要运行本地Web服务器。 Chrome只提供一个https://chrome.google.com/webstore/detail/web-server-for-chrome/ofhbbkphhbklhfoeikjpcbhemlocgigb 我是节点连接https://www.npmjs.com/package/connect
的粉丝