resourceloader: Use feature test instead of UA sniffing
authorTimo Tijhof <krinklemail@gmail.com>
Sat, 20 Feb 2016 15:22:22 +0000 (15:22 +0000)
committerOri.livneh <ori@wikimedia.org>
Mon, 18 Apr 2016 20:27:43 +0000 (20:27 +0000)
commit79e095fd8a609b71937057034ff5801c13180137
tree540dccc58d23414490dc9d7d5cb00a554ae8bfa8
parent4dcd58d3db5b355c8b7a47cb9cc0eaa63b3fae69
resourceloader: Use feature test instead of UA sniffing

Converting to a feature test reduces complexity of the startup module, and
makes the blacklist more meaningful - allowing us to safely remove some
unnecessary feature guards and polyfills.

It'll also provide unsupported browsers a much better experience. Previously,
unsupported browsers got the payload for Grade A runtime. Many of which would
likely fatal due to unimplemented DOM and JS methods. With the capability
filter in this commit, the client will only initialise the environment if the
browser is capable - falling back to Grade C otherwise.

The feature-test that replaces the user-agent filter in this commit is 99.96%
effectively the same - based on a 7 day analytics campaign on all Wikimedia
wikis (see T102318 for details).

Bug: T102318
Change-Id: I847b3f5f80f1eef3f57bbe7518768468e271082b
resources/src/startup.js
tests/qunit/suites/resources/startup.test.js