Hi, after a discussion with Jon, we decided that the usage of X-Device for CentralNotice platform-specific banners is a dead end. It has the following problems: * X-Device was created for regulating frontend caching allowing some device/browser specific CSS. It was not intended for anything else. * It is not grouped by platform. Or browser type. It is grouped by cacheable entities. * X-Device usage is dictated by performance. So if CN needs to distinguish between iPhone 4 and 5, for example, the answer will be "no can do", we can't increase cache fragmentation for the sake of banners. * We are working on decreasing the number of X-Devices: there's no guarantee that we will not merge 'android' into 'webkit' one day. * Android-based browsers can correspond to 'android', 'webkit', 'operamini' and 'operamobile' X-Device strings, the latter 3 being shared with several other platforms. We in general need to target all Android users with our app banners, not users of a specific Android browser.
Thus, we decided to change it. * https://gerrit.wikimedia.org/r/#/c/61989/ removes wgMobileDeviceName support from MobileFrontend. * https://gerrit.wikimedia.org/r/#/c/61988/ adds basic detection code to CentralNotice.
Ideally, every mobile banner could specify a user-agent regex and a special ResourceLoader module collect the regexes from all available banners.