This repository has been archived by the owner on Sep 29, 2023. It is now read-only.
Improve user agent handling/provide user agent "short" codes #1198
Merged
TheCleric
merged 12 commits into
nativefier:master
from
TheCleric:feature/improve_user_agents
May 22, 2021
Merged
Improve user agent handling/provide user agent "short" codes #1198
TheCleric
merged 12 commits into
nativefier:master
from
TheCleric:feature/improve_user_agents
May 22, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…of user-agent options
ronjouch
approved these changes
May 21, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I have a couple nits.
"Add short codes [so that users] don't have to go hunting one down"
Great idea 👍
Alright @ronjouch I think all nits have been addressed |
ronjouch
approved these changes
May 21, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍:clap:
Adam777Z
pushed a commit
to Adam777Z/nativefier
that referenced
this pull request
Nov 9, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So I took a risk with this PR (and probably should have discussed some of this with you first @ronjouch, but I started tugging on the thread of:
How can I get Google (and other apps) to behave better or make it easier for a user to be self-sufficient?
Obviously this has been an ongoing problem, but particularly in this thread, and this comment: #1193 (comment) . Not that there was anything WRONG in this question, it just got me thinking that there has to be a better way.
So this is my attempt at a "better" way. Better being in the eye of the developer though, I'm fine changing some of this until we're both happy.
Here's what I've changed:
app.userAgentFallback
which has a Chrome-like user agent pre-populated in it already, based on the Electron version used. For--honest
/--user-agent-honest
we'll use it as is. Without that we'll strip out the elements of it that indicate it's not Chrome (Electron/version and GeneratedAppName/version)--user-agent
that will determine the latest versions of some common browsers, and generate a user agent for the user, so they don't have to go hunting one down. Included is support for:edge
which will grab the chrome version by electron version likeinferUserAgent
did, and populate itfirefox
which will hit the FF versions API and get latest stable and generate a user agentsafari
which will hit Wikipedia (sorry, it's the only reliable, up to date source I could find) and get the latest version (and WebKit version) and generate a user agentuserAgentHonest
overhonest