Skip to content

Commit 1b1a968

Browse files
committed
Feature/add miui
1 parent e8c7db7 commit 1b1a968

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

main.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ var BROWSER_TYPES = {
204204
CHROMIUM: "Chromium",
205205
IE: 'IE',
206206
MOBILE_SAFARI: "Mobile Safari",
207-
EDGE_CHROMIUM: "Edge Chromium"
207+
EDGE_CHROMIUM: "Edge Chromium",
208+
MIUI: "MIUI Browser"
208209
};
209210
var OS_TYPES = {
210211
IOS: 'iOS',
@@ -444,6 +445,10 @@ var isIEType = function isIEType() {
444445
return browser.name === BROWSER_TYPES.INTERNET_EXPLORER || browser.name === BROWSER_TYPES.IE;
445446
};
446447

448+
var isMIUIType = function isMIUIType() {
449+
return browser.name === BROWSER_TYPES.MIUI;
450+
};
451+
447452
var isElectronType = function isElectronType() {
448453
var nav = getNavigatorInstance();
449454
var ua = nav && nav.userAgent.toLowerCase();
@@ -550,6 +555,7 @@ var isEdgeChromium = isEdgeChromiumType();
550555
var isLegacyEdge = isEdgeType();
551556
var isWindows = isWindowsType();
552557
var isMacOs = isMacOsType();
558+
var isMIUI = isMIUIType();
553559

554560
var AndroidView = function AndroidView(_ref) {
555561
var renderWithFragment = _ref.renderWithFragment,
@@ -789,6 +795,7 @@ exports.isIPad13 = isIPad13;
789795
exports.isIPhone13 = isIPhone13;
790796
exports.isIPod13 = isIPod13;
791797
exports.isLegacyEdge = isLegacyEdge;
798+
exports.isMIUI = isMIUI;
792799
exports.isMacOs = isMacOs;
793800
exports.isMobile = isMobile;
794801
exports.isMobileOnly = isMobileOnly;

src/components/helpers/selectors.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const isSafariType = () => browser.name === BROWSER_TYPES.SAFARI || browser.name
4040
const isMobileSafariType = () => browser.name === BROWSER_TYPES.MOBILE_SAFARI;
4141
const isOperaType = () => browser.name === BROWSER_TYPES.OPERA;
4242
const isIEType = () => browser.name === BROWSER_TYPES.INTERNET_EXPLORER || browser.name === BROWSER_TYPES.IE;
43+
const isMIUIType = () => browser.name === BROWSER_TYPES.MIUI;
4344
const isElectronType = () => {
4445
const nav = getNavigatorInstance();
4546
const ua = nav && nav.userAgent.toLowerCase();
@@ -111,3 +112,4 @@ export const isEdgeChromium = isEdgeChromiumType();
111112
export const isLegacyEdge = isEdgeType();
112113
export const isWindows = isWindowsType();
113114
export const isMacOs = isMacOsType();
115+
export const isMIUI = isMIUIType();

0 commit comments

Comments
 (0)