TheNetsky / Microsoft-Rewards-Script

Automated Microsoft Rewards script, using TypeScript, Cheerio and Playwright.
231 stars 51 forks source link

Automatically update the user agent string to show the latest Chrome/Edge versions #150

Closed kianfotovat closed 1 month ago

kianfotovat commented 2 months ago

This solves #149 and ensures the latest major Chrome/Edge version is shown in the fingerprint's user agent (both in the fingerprint and the header). I'm not sure if this is an option you'd want to pursue, given that

  1. the problem is really with fingerprint-generator, and
  2. getUserAgent exists already

The reason I didn't use getUserAgent is I assumed you stopped using it already for a good reason (no header is generated, or fingerprint-generator creates better fingerprints, etc.) so I didn't want to shoehorn it back in.

TheNetsky commented 2 months ago

There's nothing wrong with the existing functions that aren't used, the generator just did it better as well as it matching the the rest of the specifications. So it was safer and easier to use that instead.

However is there an issue with the browser not being up to date?

kianfotovat commented 2 months ago

No I haven't encountered any issues. I'm not well-versed in web automation but I doubt Microsoft is monitoring user agent strings to see if the browser you collect rewards on is different than the one you normally use. I mostly did this just because it bugged me a bit and I figured I'd open the PR on the off chance it was useful.

JittoJoseph commented 2 months ago

probably a nice to have feature

TheNetsky commented 2 months ago

I'll take a look at it later, however this is something that must not been taking lightly, since I don't know how much MS uses to track accounts. So I'll have to do some testing if applying these "new" fingerprints to the ones generated will causes issues or not. I do know some sites do check for these specifics and raise flags if they don't match.

TheNetsky commented 1 month ago

I've fixed the issue using the built in "browserListQuery" which uses https://github.com/browserslist/browserslist