-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow relative sw.js registration #111
Comments
@zorn-v use |
Nope. But |
Our case sounds similar to yours. We use the lightning deployment strategy and host our assets on a CDN. Now when we serve the index.html './sw.js' is not found as this is on the CDN. So we should be able to have a different configuration option for scope and URL of the sw.js file: Hmm, but it seems that we cannot specify different subdomains due to security issues... |
Service Workers need to be hosted on the same domain. CDN's are not allowed. |
Thanks for the clarification @martndemus . Maybe this is something for the docs as well? |
I'd rather not go into the rabbit hole of repeating general SW knowledge. |
There is some work in progress being made in |
Another approach I have used in the lighting strategy, instead of hosting the service worker in the same place as index.html, is to simply have the lightning server forward the request for sw.js to the CDN |
Good general information in here but nothing actionable that I see so closing this out. |
Really ? Remove slash and add ONE DOT with no drawbacks and many buns ? |
Hi there @zorn-v. It's quite possible that I've missed something here, so if you'd like to further explain - or submit a PR with your suggestion I'd be happy to look further and/or re-open this issue. |
Currently it is imposible. But in ember if no rootURL is defined assets inserted with relative url.
I think "last resort" should be '' but not '/' here https://github.com/DockYard/ember-service-worker/blob/master/index.js#L144
PS. I have a project with no deterministic root url. Just imagine a 'skel' with symlinks to it, and logic depends of result url.
Anyway I implemented SW by my own (with 'scope':'./'), but it is big mistake to restrict relative urls...
The text was updated successfully, but these errors were encountered: