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

Route showNotification() URLs through a fetch event? #1161

Closed
alastaircoote opened this issue Jun 11, 2017 · 2 comments
Closed

Route showNotification() URLs through a fetch event? #1161

alastaircoote opened this issue Jun 11, 2017 · 2 comments

Comments

@alastaircoote
Copy link

Right now (on Firefox and Chrome, at least) any image, icon and badge URL passed into showNotification() goes straight to the remote URL. It would be a much better experience if those requests were routed through the fetch event, so that we could use cached assets instead.

There is a work-around using cache.match() -> res.blob() -> FileReader.readAsDataURL(), but it's pretty inefficient since the lack of URL.createObjectURL (as removed in #688) means that every image is turned into a base-64 encoded string. Since the introduction of the image attribute, some of these images can be pretty huge.

@jakearchibald
Copy link
Contributor

We've already made this change in the spec, we're just waiting for browsers to catch up.

@alastaircoote
Copy link
Author

Fantastic news. Thanks!

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