markcellus / cookie-store

A polyfill for the Cookie Store API
MIT License
106 stars 16 forks source link

Support local origins like http://localhost, file://, etc? #141

Open karlhorky opened 3 years ago

karlhorky commented 3 years ago

Hi @markcellus, thanks for this polyfill, really cool!

I wanted to use it to teach using a modern cookies API to our students at @upleveled, but quickly ran into issues because of an HTTP-only dev server (a very common out-of-the-box configuration among tooling - it often takes work to set up a secure HTTPS dev server). I had to discard the idea of teaching cookieStore again unfortunately.

Would there be interest in mirroring the feature below that just recently received the Intent to Ship status?

Summary

The Cookie Store API exposes HTTP cookies to service workers and offers an asynchronous alternative to document.cookie. This change is about exposing it to all secure contexts by including allowing local origins (127.0.0.1, localhost address, file://...).

This allows developers to quickly experiment things locally, without the need to set up a HTTPs server.

https://groups.google.com/a/chromium.org/g/blink-dev/c/ekdeaj09c0w

markcellus commented 3 years ago

@karlhorky thanks for filing the issue and for the kind words :) We're all very excited about the CookieStore specification as well. But the repo is currently still in an experimental stage. We're keeping close watch of the spec, but don't want to get too ahead of ourselves because, as you may already know, the spec can change at any time :wink: .

If urgent, it may be better to just fork and add the feature to the codebase yourself to use for your lessons. In fact, if you do that, it would be pretty easy to open your forked version of the feature into a pull request right against this repo.

Let me know if you have any other questions in the meantime and all the best with your coding bootcamp. It sounds very cool. :raised_hands: