Skip to content

Commit

Permalink
Minor updates to detect Blackberry 10.
Browse files Browse the repository at this point in the history
  • Loading branch information
muaz-khan committed Jul 1, 2016
1 parent 07822b5 commit cd9ce9b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
6 changes: 3 additions & 3 deletions DetectRTC.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Last time updated: 2016-05-24 2:44:27 PM UTC
// Last time updated: 2016-06-17 7:44:40 AM UTC

// Latest file can be found here: https://cdn.webrtc-experiment.com/DetectRTC.js

Expand Down Expand Up @@ -80,7 +80,7 @@
};
}

var isMobileDevice = !!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|mobile/i.test(navigator.userAgent || ''));
var isMobileDevice = !!(/Android|webOS|iPhone|iPad|iPod|BB10|BlackBerry|IEMobile|Opera Mini|Mobile|mobile/i.test(navigator.userAgent || ''));

var isEdge = navigator.userAgent.indexOf('Edge') !== -1 && (!!navigator.msSaveOrOpenBlob || !!navigator.msSaveBlob);

Expand Down Expand Up @@ -287,7 +287,7 @@
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i);
return navigator.userAgent.match(/BlackBerry|BB10/i);
},
iOS: function() {
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
Expand Down
4 changes: 2 additions & 2 deletions DetectRTC.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev/getBrowserInfo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var isMobileDevice = !!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|mobile/i.test(navigator.userAgent || ''));
var isMobileDevice = !!(/Android|webOS|iPhone|iPad|iPod|BB10|BlackBerry|IEMobile|Opera Mini|Mobile|mobile/i.test(navigator.userAgent || ''));

var isEdge = navigator.userAgent.indexOf('Edge') !== -1 && (!!navigator.msSaveOrOpenBlob || !!navigator.msSaveBlob);

Expand Down
2 changes: 1 addition & 1 deletion dev/isMobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var isMobile = {
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i);
return navigator.userAgent.match(/BlackBerry|BB10/i);
},
iOS: function() {
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
Expand Down
7 changes: 6 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,14 @@ <h2 id="welcome">DetectRTC!</h2>
<script>
var browserFeaturesTable = document.querySelector('#browser-features');

var screenWidth00 = innerWidth;
if(document.querySelector('article')) {
screenWidth00 = document.querySelector('article').clientWidth;
}

function appendTR(firstValue, secondValue) {
var tr = document.createElement('tr');
tr.innerHTML = '<td style="padding:5px;max-width:' + (parseInt(innerWidth / 2) - 180) + 'px; overflow:hidden;">' + firstValue + '</td><td style="padding:5px;">' + secondValue + '</td>';
tr.innerHTML = '<td style="padding:5px;width:' + (parseInt(screenWidth00 / 2) - 180) + 'px!important; overflow:hidden;">' + firstValue + '</td><td style="padding:5px;">' + secondValue + '</td>';
browserFeaturesTable.appendChild(tr);
return tr;
}
Expand Down

0 comments on commit cd9ce9b

Please sign in to comment.