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

Add User Agent API #100

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

donny-dont
Copy link
Contributor

Allow a libwpe application to set user agent information. The libwpe API maps to values exposed by the User-Agent Client Hints API.

@donny-dont
Copy link
Contributor Author

donny-dont commented Mar 25, 2022

So this is a proposal for a new libWPE API. As mentioned it follows along with what is currently in https://wicg.github.io/ua-client-hints which is in draft status so it is subject to change. Chrome does seem to be shipping it if you open up https://user-agent-client-hints.glitch.me/javascript.html in it.

Please feel free to criticize this PR fully. I think it follows along with how the libWPE APIs look but I'm not an expert at how this should look.

Note I don't think this will land as is so I'm just marking it as a WIP and hopefully we can get the discussion around it going.

@donny-dont donny-dont marked this pull request as draft March 25, 2022 17:40
@donny-dont donny-dont force-pushed the user-agent-api branch 2 times, most recently from 64c1fe6 to 8f91f8d Compare March 25, 2022 22:08
Allow a libwpe application to set user agent information. The libwpe API maps to values exposed by the User-Agent Client Hints API.
@mcatanzaro
Copy link
Contributor

This is really tricky. WPE WebKit already has an API for setting the user agent header that would have to be respected if used, but it's not nearly as sophisticated as what you have here. But on the other hand, providing accurate user agent information is rarely desirable: the goal here is to lie enough to make the web work, not expose enough platform details to encourage websites to discriminate.

I don't think WebKit intends to implement client hints, so not sure that the full complexity is really useful.

One way to think about this: what's the advantage of putting this into libwpe rather than just implementing it in UserAgentPlaystation and UserAgentGLib? Are there really device-specific details here that cannot be handled without custom code?

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

Successfully merging this pull request may close these issues.

2 participants