The service worker must be deployed such that it can served from the root of the site
- get service worker code
git clone https://github.com/kdevar/service-worker-poc.git
cd service-workers
yarn install
yarn build:local //will deploy code to c:\inetpub\wwwroot
-
Open the c# project and find shelveset service-worker-prefetch-cache-impl
-
Use a special version of chrome to run project locally (this only applies to local development). Service workers can only be served over https with localhost being the exception. Since the property project is served over http locally and not from "localhost", we have to use a workaround. Also, make sure you have either chrome 64 or 62 but not 63 for this workaround.
- create a folder somewhere for an alternate chrome profile (e.g. c:\profile)
- go to Run
- chrome --user-data-dir=c:\profile --unsafely-treat-insecure-origin-as-secure={local-url}
-
Run the property project
-
you should be able see messages prefixed with serviceworker in the chrome console