SailyTeam / Saily

Modern. Fast. Beautiful.
The Unlicense
778 stars 56 forks source link

Identify user agent in web view requests #87

Closed kirb closed 2 years ago

kirb commented 2 years ago

Currently Saily presents itself as Cydia when making web view requests:

Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Cydia/1.1.32

In the case of Chariz, this makes it load a Cydia-specific experience (the Log In button which is the fallback login system only for Cydia). I can’t change this without using clunky logic like this which feels bound to break in future:

let isCydiaCompatible = userAgent.includes("Cydia/");
let isZebra = isCydiaCompatible && userAgent.includes("Zebra/");
let isSaily = isCydiaCompatible && !isZebra && userAgent.includes("Cydia/1.1.32");
let isCydia = isCydiaCompatible && !isZebra && !isSaily && userAgent.includes("CyF/");

Could you please change this to include some token that identifies the requests as coming from Saily.

Lakr233 commented 2 years ago

Implemented and merged.

When user upgrading to new version, default value for UserDefault under key "wiki.qaq.chromatic.mainUserAgent" is "Saily/2.0 Cydia/1.1.32". User can change this value inside Setting Page.

Simulator Screen Shot - iPad mini (6th generation) - 2022-02-01 at 03 29 41