Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

provide support for MS Surface RT #94

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ info.description; // 'Opera 11.52 (identifying as Firefox 4.0) on Mac OS X 10.7.
```
## Support

Tested in Chrome 46-47, Firefox 42-43, IE 8-11, MS Edge 13, Safari 8-9, Node.js 0.8.28, 0.10.41, 0.12.9, 4.2.4, & 5.3.0, & PhantomJS 1.9.8.
Tested in Chrome 46-47, Firefox 42-43, IE 8-11, Edge 13, Safari 8-9, Node.js 0.10.x, 0.12.x, 4.x, & 5.x, & PhantomJS 1.9.8.

## BestieJS

Expand Down
7 changes: 7 additions & 0 deletions platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@
'PlayStation 3',
'PlayStation 4',
'PlayStation Vita',
{ 'label': 'Surface RT', 'pattern': 'Tablet PC 2.0'},
'TouchPad',
'Transformer',
{ 'label': 'Wii U', 'pattern': 'WiiU' },
Expand Down Expand Up @@ -703,6 +704,12 @@
description.unshift('desktop mode');
version || (version = (/\brv:([\d.]+)/.exec(ua) || 0)[1]);
}
// Detect IE 11 Mobile (Surface).
else if (/\bTablet PC\b/i.test(ua)) {
name = 'IE Mobile';
os = 'Windows RT 8.1';
version || (version = (/\brv:([\d.]+)/.exec(ua) || 0)[1]);
}
// Detect IE 11.
else if (name != 'IE' && layout == 'Trident' && (data = /\brv:([\d.]+)/.exec(ua))) {
if (name) {
Expand Down
9 changes: 9 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1336,6 +1336,15 @@
'version': '11.0'
},

'IE Mobile 11.0 on Surface RT (Windows RT 8.1)': {
'ua': 'Mozilla/5.0 (Windows NT 6.3; ARM; Trident/7.0; Touch; .NET4.0E; .NET4.0C; Tablet PC 2.0; rv:11.0) like Gecko',
'layout': 'Trident',
'name': 'IE Mobile',
'os': 'Windows RT 8.1',
'product': 'Surface RT',
'version': '11.0'
},

'SRWare Iron 0.2.152.0 on Windows Vista / Server 2008': {
'ua': 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Iron/0.2.152.0 Safari/41562480.525',
'layout': 'WebKit',
Expand Down