Skip to content

Commit

Permalink
🎉 Release 2.2.0 - Supported Android 8.0/ iOS 10/11 (iPhone/iPad)
Browse files Browse the repository at this point in the history
  • Loading branch information
fkei committed Jan 29, 2018
1 parent 5d072e4 commit d30dca1
Show file tree
Hide file tree
Showing 5 changed files with 159 additions and 92 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,23 @@ Supported Browsers
- [x] ua.Android 6.x
- [x] ua.Android 7.0
- [x] ua.Android 7.1
- [x] ua.Android 8.0
- [x] ua.iphone (IOS4)
- [x] ua.iphone (IOS5)
- [x] ua.iphone (IOS6)
- [x] ua.iphone (IOS7)
- [x] ua.iphone (IOS8)
- [x] ua.iphone (IOS9)
- [x] ua.iphone (IOS10)
- [x] ua.iphone (IOS11)
- [x] ua.iphone (IOS4-ipad)
- [x] ua.iphone (IOS5-ipad)
- [x] ua.iphone (IOS6-ipad)
- [x] ua.iphone (IOS7-ipad)
- [x] ua.iphone (IOS8-ipad)
- [x] ua.iphone (IOS9-ipad)
- [x] ua.iphone (IOS10-ipad)
- [x] ua.iphone (IOS11-ipad)
- [x] ua.iphone5 (hardware)
- [x] ua.blackberry
- [x] ua.webos
Expand Down Expand Up @@ -69,6 +74,23 @@ Supported Browsers

## Usage

#### example iOS 11

```
<script src="sua.js" />
<script>
var sua = new SUA('Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1');
if (sua.ios11) {
// OK!!
}
</script>
```

#### example detail view!


```
<script src="sua.js" />
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sua.js",
"version": "2.1.0",
"version": "2.2.0",
"description": "Simple user agent detection library.",
"license": "MIT",
"keywords": [
Expand Down
15 changes: 11 additions & 4 deletions sua.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,19 @@
*/
this.android6 = useragent.match(/(Android)\s+(6)([\d.]+)/),
/**
* Decision: android6.x
* Decision: android7.x
* @name android
* @memberof ua
* @return {Array}
*/
this.android7 = useragent.match(/(Android)\s+(7)([\d.]+)/),
/**
* Decision: android8.x
* @name android
* @memberof ua
* @return {Array}
*/
this.android8 = useragent.match(/(Android)\s+(8)([\d.]+)/),
/**
* Decision: ipad
* @name ipad
Expand Down Expand Up @@ -334,9 +341,9 @@
if (this.os.ios) {
var __ios_v_0 = null;
if (this.os.version) {
__ios_v_0 = this.os.version.substring(0, 1);
__ios_v_0 = this.os.version.split('.')[0];
}
for (var i = 3; i < 10; i++) { // IOS 3->9
for (var i = 3; i < 12; i++) { // IOS 3->9
/**
* Decision: ios 3-9
* @name ios3-9
Expand Down Expand Up @@ -469,7 +476,7 @@
}
}

SUA.VERSION = '2.1.0';
SUA.VERSION = '2.2.0';

if (typeof module !== 'undefined' && module.exports) {
// node
Expand Down
4 changes: 2 additions & 2 deletions sua.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d30dca1

Please sign in to comment.