Skip to content

Commit d02ea4e

Browse files
committed
feat: add HarmonyOS
1 parent 4d0fe93 commit d02ea4e

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
```html
88
CDN
99

10-
<script src="https://www.unpkg.com/@skillnull/device-js@1.1.11/dist/device.export.js"></script>
10+
<script src="https://www.unpkg.com/@skillnull/device-js@1.1.12/dist/device.export.js"></script>
1111
# or
12-
<script src="https://cdn.jsdelivr.net/npm/@skillnull/device-js@1.1.11/dist/device.export.js"></script>
12+
<script src="https://cdn.jsdelivr.net/npm/@skillnull/device-js@1.1.12/dist/device.export.js"></script>
1313
```
1414

1515
```shell

device.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const Device = (function () {
88
infoMap: {
99
engine: ['WebKit', 'Trident', 'Gecko', 'Presto'],
1010
browser: ['Safari', 'Chrome', 'Edge', 'IE', 'Firefox', 'Firefox Focus', 'Chromium', 'Opera', 'Vivaldi', 'Yandex', 'Arora', 'Lunascape', 'QupZilla', 'Coc Coc', 'Kindle', 'Iceweasel', 'Konqueror', 'Iceape', 'SeaMonkey', 'Epiphany', '360', '360SE', '360EE', 'UC', 'QQBrowser', 'QQ', 'Baidu', 'Maxthon', 'Sogou', 'LBBROWSER', '2345Explorer', 'TheWorld', 'XiaoMi', 'Quark', 'Qiyu', 'Wechat', , 'WechatWork', 'Taobao', 'Alipay', 'Weibo', 'Douban', 'Suning', 'iQiYi'],
11-
os: ['Windows', 'Linux', 'Mac OS', 'Android', 'Ubuntu', 'FreeBSD', 'Debian', 'iOS', 'Windows Phone', 'BlackBerry', 'MeeGo', 'Symbian', 'Chrome OS', 'WebOS'],
11+
os: ['Windows', 'Linux', 'Mac OS', 'Android', 'Ubuntu', 'FreeBSD', 'Debian', 'iOS', 'Windows Phone', 'BlackBerry', 'MeeGo', 'Symbian', 'Chrome OS', 'WebOS', 'HarmonyOS'],
1212
device: ['Mobile', 'Tablet', 'iPad']
1313
},
1414
// 农历相关
@@ -240,6 +240,7 @@ const Device = (function () {
240240
'iOS': u.indexOf('like Mac OS X') > -1,
241241
'Chrome OS': u.indexOf('CrOS') > -1,
242242
'WebOS': u.indexOf('hpwOS') > -1,
243+
'HarmonyOS': u.indexOf('HarmonyOS') > -1,
243244
// 设备
244245
'Mobile': u.indexOf('Mobi') > -1 || u.indexOf('iPh') > -1 || u.indexOf('480') > -1,
245246
'Tablet': u.indexOf('Tablet') > -1 || u.indexOf('Nexus 7') > -1,
@@ -884,7 +885,7 @@ const Device = (function () {
884885
}
885886
return ChineseDate
886887
}
887-
888+
888889
let lunarYearArr = String(lunar.lunarYear).split('')
889890
let chineseYear = `${VariableLibrary.lunarLib.chineseYear[lunarYearArr[0]]}${VariableLibrary.lunarLib.chineseYear[lunarYearArr[1]]}${VariableLibrary.lunarLib.chineseYear[lunarYearArr[2]]}${VariableLibrary.lunarLib.chineseYear[lunarYearArr[3]]}`
890891

@@ -981,4 +982,4 @@ const Device = (function () {
981982
})
982983
}
983984
}
984-
})();
985+
})()

dist/device.export.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var Device = function () {
1414
infoMap: {
1515
engine: ['WebKit', 'Trident', 'Gecko', 'Presto'],
1616
browser: ['Safari', 'Chrome', 'Edge', 'IE', 'Firefox', 'Firefox Focus', 'Chromium', 'Opera', 'Vivaldi', 'Yandex', 'Arora', 'Lunascape', 'QupZilla', 'Coc Coc', 'Kindle', 'Iceweasel', 'Konqueror', 'Iceape', 'SeaMonkey', 'Epiphany', '360', '360SE', '360EE', 'UC', 'QQBrowser', 'QQ', 'Baidu', 'Maxthon', 'Sogou', 'LBBROWSER', '2345Explorer', 'TheWorld', 'XiaoMi', 'Quark', 'Qiyu', 'Wechat',, 'WechatWork', 'Taobao', 'Alipay', 'Weibo', 'Douban', 'Suning', 'iQiYi'],
17-
os: ['Windows', 'Linux', 'Mac OS', 'Android', 'Ubuntu', 'FreeBSD', 'Debian', 'iOS', 'Windows Phone', 'BlackBerry', 'MeeGo', 'Symbian', 'Chrome OS', 'WebOS'],
17+
os: ['Windows', 'Linux', 'Mac OS', 'Android', 'Ubuntu', 'FreeBSD', 'Debian', 'iOS', 'Windows Phone', 'BlackBerry', 'MeeGo', 'Symbian', 'Chrome OS', 'WebOS', 'HarmonyOS'],
1818
device: ['Mobile', 'Tablet', 'iPad']
1919
},
2020
// 农历相关
@@ -221,6 +221,7 @@ var Device = function () {
221221
'iOS': u.indexOf('like Mac OS X') > -1,
222222
'Chrome OS': u.indexOf('CrOS') > -1,
223223
'WebOS': u.indexOf('hpwOS') > -1,
224+
'HarmonyOS': u.indexOf('HarmonyOS') > -1,
224225
// 设备
225226
'Mobile': u.indexOf('Mobi') > -1 || u.indexOf('iPh') > -1 || u.indexOf('480') > -1,
226227
'Tablet': u.indexOf('Tablet') > -1 || u.indexOf('Nexus 7') > -1,

dist/device.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var Device = function () {
1010
infoMap: {
1111
engine: ['WebKit', 'Trident', 'Gecko', 'Presto'],
1212
browser: ['Safari', 'Chrome', 'Edge', 'IE', 'Firefox', 'Firefox Focus', 'Chromium', 'Opera', 'Vivaldi', 'Yandex', 'Arora', 'Lunascape', 'QupZilla', 'Coc Coc', 'Kindle', 'Iceweasel', 'Konqueror', 'Iceape', 'SeaMonkey', 'Epiphany', '360', '360SE', '360EE', 'UC', 'QQBrowser', 'QQ', 'Baidu', 'Maxthon', 'Sogou', 'LBBROWSER', '2345Explorer', 'TheWorld', 'XiaoMi', 'Quark', 'Qiyu', 'Wechat',, 'WechatWork', 'Taobao', 'Alipay', 'Weibo', 'Douban', 'Suning', 'iQiYi'],
13-
os: ['Windows', 'Linux', 'Mac OS', 'Android', 'Ubuntu', 'FreeBSD', 'Debian', 'iOS', 'Windows Phone', 'BlackBerry', 'MeeGo', 'Symbian', 'Chrome OS', 'WebOS'],
13+
os: ['Windows', 'Linux', 'Mac OS', 'Android', 'Ubuntu', 'FreeBSD', 'Debian', 'iOS', 'Windows Phone', 'BlackBerry', 'MeeGo', 'Symbian', 'Chrome OS', 'WebOS', 'HarmonyOS'],
1414
device: ['Mobile', 'Tablet', 'iPad']
1515
},
1616
// 农历相关
@@ -217,6 +217,7 @@ var Device = function () {
217217
'iOS': u.indexOf('like Mac OS X') > -1,
218218
'Chrome OS': u.indexOf('CrOS') > -1,
219219
'WebOS': u.indexOf('hpwOS') > -1,
220+
'HarmonyOS': u.indexOf('HarmonyOS') > -1,
220221
// 设备
221222
'Mobile': u.indexOf('Mobi') > -1 || u.indexOf('iPh') > -1 || u.indexOf('480') > -1,
222223
'Tablet': u.indexOf('Tablet') > -1 || u.indexOf('Nexus 7') > -1,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@skillnull/device-js",
3-
"version": "1.1.11",
3+
"version": "1.1.12",
44
"description": "Get device information by javascript.",
55
"main": "dist/device.export.js",
66
"scripts": {

0 commit comments

Comments
 (0)