Skip to content
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

Switch to relative URLs #8

Open
jeffposnick opened this issue Sep 14, 2015 · 2 comments
Open

Switch to relative URLs #8

jeffposnick opened this issue Sep 14, 2015 · 2 comments

Comments

@jeffposnick
Copy link

Many of the URLs within the source are absolutely, starting with /. This makes it more difficult than it needs be to deploy somewhere that isn't the root of a domain.

E.g. xhr.open('GET', '/sounds/airhorn.mp3' ); would be more flexible if it were xhr.open('GET', 'sounds/airhorn.mp3' );

There's another case where / is used as the scope for the SW registration, and that's an anti-pattern. / will never be valid unless the registering page is also served from the top-level, and if that's the case, you might as well just leave it with the default scope of ./.

@TotallyInformation
Copy link

All of the references to '/' should be replaced with window.location.pathname which would fix the problems.

@paulirish
Copy link

Fixed in 5bdad5e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants