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

Document the API #3605

Open
foolip opened this issue Jan 24, 2024 · 5 comments
Open

Document the API #3605

foolip opened this issue Jan 24, 2024 · 5 comments

Comments

@foolip
Copy link
Member

foolip commented Jan 24, 2024

Is your feature request related to a problem? Please describe.

I'd like to enumerate Chrome launches between Chrome 72 and 120, covering the 5 years 2019-2023. Using DevTools, I figure out I could use the following URL:

https://chromestatus.com/api/v0/features?q=browsers.chrome.desktop%3E%3D72+browsers.chrome.desktop%3C%3D120

However, I found that the response begins with )]}' and isn't valid JSON. Stripping characters up to the first { seems to work.

Describe the solution you'd like

Document the API and make it possible to use for external code.

Additional context

The purpose of all this is to make a spreadsheet of recent launches and map them to https://github.com/web-platform-dx/web-features.

@foolip
Copy link
Member Author

foolip commented Jan 24, 2024

@rachelandrew
Copy link

I've just run into the same issue with the JSON, would be great to have some docs for the API (and to fix this issue!)

@jrobbins
Copy link
Collaborator

The prefix is for security. See go/xssi fifth bullet item. Client code should strip those characters from the response.

@foolip
Copy link
Member Author

foolip commented Mar 24, 2024

I see. It would be good to document what rules a client should apply. Is it to always strip a fixed number of bytes regardless of the response, or perhaps to expect the bytes )]}' plus a newline and fail if it's some other sequence?

@jrobbins
Copy link
Collaborator

It should always that sequence with the newline, so clients can count on that.

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

No branches or pull requests

4 participants
@jrobbins @foolip @rachelandrew and others