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

User-Agent Fix for OrangeDrangon/android-messages-desktop#441 #450

Merged
merged 1 commit into from
Jun 8, 2024

Conversation

drislands
Copy link

Modified how the user agent is set when sending headers. There were two issues that I was able to identify.

First, the Google sign-in page sends requests to the youtube.com domain sometimes, so the existing replacement effect was not always firing. Adding a url entry for this domain fixes this problem.

Second, Google sometimes doesn't like the hard-coded user agent this project was previously providing. I have no idea why -- this Electron/user agent/Google problem has been ongoing for years. I've solved this problem this time by instead taking the user agent Electron would have passed by itself and stripping out only the Electron-specific component.

I don't know how long this fix will last, since Google seems intent on being opaque about how they determine if a browser is secure or not. Fingers crossed.

Modified how the user agent is set when sending headers. There were two issues that I was able to identify.

First, the Google sign-in page sends requests to the youtube.com domain sometimes, so the existing replacement effect was not always firing. Adding a url entry for this domain fixes this problem.

Second, Google sometimes doesn't like the hard-coded user agent this project was previously providing. I have no idea why -- this Electron/user agent/Google problem has been ongoing for years. I've solved this problem this time by instead taking the user agent Electron would have passed by itself and stripping out only the Electron-specific component.

I don't know how long this fix will last, since Google seems intent on being opaque about how they determine if a browser is secure or not. Fingers crossed.
@OrangeDrangon
Copy link
Owner

@drislands thanks for the patch will get it released once the checks finish

@OrangeDrangon OrangeDrangon merged commit 528f80c into OrangeDrangon:master Jun 8, 2024
4 checks passed
@drislands
Copy link
Author

@OrangeDrangon Thank you! Glad I was able to help.

@drislands drislands deleted the bugfix/441 branch June 8, 2024 21:14
@drislands
Copy link
Author

@OrangeDrangon I just saw one of the checks failed with an "already_exists" error code -- is this something I should have seen and fixed before the PR? I'm not sure what the solution is but I'll do whatever it needs to make it work.

@OrangeDrangon
Copy link
Owner

OrangeDrangon commented Jun 8, 2024 via email

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

Successfully merging this pull request may close these issues.

3 participants