Skip to content

Commit

Permalink
Add bandwidth and metered as well from connection
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Tellis committed Jan 15, 2014
1 parent 42df79d commit c075df2
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion plugins/mobile.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,4 +3,18 @@
Plugin to capture navigator.connection.type on browsers that support it Plugin to capture navigator.connection.type on browsers that support it
*/ */


BOOMR.addVar("mob.ct", (typeof navigator === 'object' && navigator.connection) ? navigator.connection.type : 0); (function() {
var connection;

if(typeof navigator === 'object') {
connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection || navigator.msConnection;
}

if(!connection) {
return;
}
BOOMR.addVar("mob.ct", connection.type);
BOOMR.addVar("mob.bw", connection.bandwidth);
BOOMR.addVar("mob.mt", connection.metered);

}());

0 comments on commit c075df2

Please sign in to comment.