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

Navigation preload shouldn't occur when there is no fetch event handler #1058

Closed
mfalken opened this issue Jan 20, 2017 · 2 comments
Closed
Assignees

Comments

@mfalken
Copy link
Member

mfalken commented Jan 20, 2017

As written, the spec sends a navigation preload (#920) request even if there is no fetch event handler.

But this seems meaningless. The SW can't use the preload response. And the "real" navigation request will be sent immediately after the preload request since SW startup doesn't happen.

We could possibly reject the enable() promise in this case, or at least browsers should emit a developer warning.

Chrome 57's implementation does not send the preload, but it doesn't yet warn or reject on enable(), which could be confusing.

WDYT? @jakearchibald @n8schloss @wanderview

@jakearchibald jakearchibald self-assigned this Jan 20, 2017
@jakearchibald
Copy link
Contributor

Good catch. The preload fetch shouldn't be sent if there's no fetch listener.

I don't think enable() should reject in this case, as preloading is a property of the registration, but "having a fetch listener" is a property of the service worker. Eg, I could successfully enable(), then update to a service worker without a fetch handler.

@mfalken
Copy link
Member Author

mfalken commented Jan 20, 2017

I don't think enable() should reject in this case, as preloading is a property of the registration, but "having a fetch listener" is a property of the service worker. Eg, I could successfully enable(), then update to a service worker without a fetch handler.

Makes sense.

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

2 participants