KoLmafia user agent string

ajoshi

Member
Hello! From what I understand, mafia specifies its user agent as its current version so Jick and co. can identify which requests come from mafia, and which from a normal browser.

However, if the standard mafia user agent is used on an Android device, I simply cannot get to the mobile-friendly layout. Even if I enable mobile mode, I revert to non-mobile.

In order to use mobile layout with mafia, is it crazy to set the useragent to be something like "Android /4.0 Mobile Safari/" + KoLConstants.VERSION_NAME; if (hypothetically) on Android?

It differentiates mafia from a standard mobile browser, but it also allows the mobile interface to be used.

Admittedly, it is not 4.0 Mobile Safari, and maybe that part is superfluous, but the core question still stands:
Is
Code:
ANDROID_PREFIX + KoLConstants.VERSION_NAME;
an acceptable useragent string? Is this more of a question for TPTB?
 

lostcalpolydude

Developer
Staff member
That seems fine. Differentiating it from the normal KoLmafia user agent seems like a good idea, at least from the perspective of being able to use that value when responding to KoL bug reports.
 

ajoshi

Member
Awesome! Yeah, given that vanilla mafia (that's a thing now?) has its own User Agent string, it seemed right that the Android version should have its own as well. Setting it via reflection, so all should be well. Thanks!
 
Top