- From: Max Barrett <notifications@github.com>
- Date: Mon, 07 Dec 2015 22:00:55 -0800
- To: slightlyoff/ServiceWorker <ServiceWorker@noreply.github.com>
Received on Tuesday, 8 December 2015 06:01:30 UTC
The current documentation is a little misleading – it appears to say the default scope is the web root.
In reality the default scope is relative to the location of the ServiceWorker script.
If a ServiceWorker is located in: `/my-app/sw.js` and the scope is set to: `scope: '/'` an error will throw:
`DOMException: Failed to register a ServiceWorker: The path of the provided scope ('/') is not under the max scope allowed ('/assets/'). Adjust the scope, move the Service Worker script, or use the Service-Worker-Allowed HTTP header to allow the scope.`
I've updated the documentation to show this.
You can view, comment on, or merge this pull request online at:
https://github.com/slightlyoff/ServiceWorker/pull/797
-- Commit Summary --
* ServiceWorker scope documentation in explainer.md
-- File Changes --
M explainer.md (2)
-- Patch Links --
https://github.com/slightlyoff/ServiceWorker/pull/797.patch
https://github.com/slightlyoff/ServiceWorker/pull/797.diff
---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/pull/797
Received on Tuesday, 8 December 2015 06:01:30 UTC