Skip to content

fix: change user-agent at runtime #4478

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

Merged
merged 2 commits into from
Apr 27, 2025
Merged

fix: change user-agent at runtime #4478

merged 2 commits into from
Apr 27, 2025

Conversation

imLinguin
Copy link
Member

@imLinguin imLinguin commented Apr 17, 2025

This should address the login issue. In the meantime simply going through Heroic's Manage Accounts page will let users log in.
This PR fixes the regression when going to login through Stores tab

Closes #4477
Closes #4460
Closes #4433
Closes #4419
Closes #4289
Closes #4223
Closes #4430

Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

@imLinguin imLinguin requested review from a team, arielj, flavioislima, CommandMC and Nocccer and removed request for a team April 17, 2025 18:25
@arielj
Copy link
Collaborator

arielj commented Apr 17, 2025

Just curious, why is the at runtime part needed? I think it would be good to add a comment about that in the code so we don't break this accidentally in a refactor or something

@Etaash-mathamsetty
Copy link
Member

Just curious, why is the at runtime part needed? I think it would be good to add a comment about that in the code so we don't break this accidentally in a refactor or something

Otherwise the user agent is only set once for the first URL and is never updated again

@imLinguin
Copy link
Member Author

exactly what @Etaash-mathamsetty said, useragent provided to webview tag is a one-time property. Since we need different user agent for Epic's login and different for Epic's website, we need to be able to change that property at any point while webview is rendered.
Most issues I see in the issues I linked are related to users using Store tab, which as it is now, wouldn't change user-agent when redirected to Heroic's Epic login route

Copy link
Member

@Etaash-mathamsetty Etaash-mathamsetty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@CommandMC CommandMC merged commit 10ac223 into main Apr 27, 2025
8 of 9 checks passed
@CommandMC CommandMC deleted the fix/epic-page-login branch April 27, 2025 12:45
@Heroic-Games-Launcher Heroic-Games-Launcher locked and limited conversation to collaborators Apr 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants