You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
570 B

4 years ago
/**
* $.os.plus
* @param {type} $
* @returns {undefined}
*/
(function($, document) {
function detect(ua) {
this.os = this.os || {};
var plus = ua.match(/Html5Plus/i); //TODO 5\+Browser?
if (plus) {
this.os.plus = true;
$(function() {
document.body.classList.add($.className('plus'));
});
if (ua.match(/StreamApp/i)) { //TODO 最好有流应用自己的标识
this.os.stream = true;
$(function() {
document.body.classList.add($.className('plus-stream'));
});
}
}
}
detect.call($, navigator.userAgent);
})(mui, document);