Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

device

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

device - npm Package Compare versions

Comparing version 0.3.3 to 0.3.4

3

lib/device.js

@@ -60,2 +60,5 @@ /* Based on Categorizr (https://github.com/bjankord/Categorizr) by Brett Jankord (http://www.brettjankord.com) */

return self.options.carUserAgentDeviceType;;
} else if (ua.match(/Googlebot/i)) {
// if user agent is a BOT/Crawler/Spider
return self.options.botUserAgentDeviceType;
} else if (ua.match(/iP(a|ro)d/i) || (ua.match(/tablet/i) && !ua.match(/RX-34/i)) || ua.match(/FOLIO/i)) {

@@ -62,0 +65,0 @@ // if user agent is a Tablet

2

package.json

@@ -6,3 +6,3 @@ {

"keywords": ["browser","mobile","detection","user-agent","useragent","desktop","phone","tablet","tv","bot","car","parsing","device"],
"version": "0.3.3",
"version": "0.3.4",
"main": "./index.js",

@@ -9,0 +9,0 @@ "private": false,

@@ -99,3 +99,3 @@ # device [![Build Status](https://secure.travis-ci.org/rguerreiro/device.png?branch=master)](http://travis-ci.org/rguerreiro/device) [![NPM version](https://badge.fury.io/js/device.svg)](http://badge.fury.io/js/device)

Currently, `device` is on **version 0.3.3**. In order to add more features I'm asking anyone to contribute with some ideas. You can do it by making some feature requests on the issues panel, but I prefer that you make your contribution with some pull requests ;)
Currently, `device` is on **version 0.3.4**. In order to add more features I'm asking anyone to contribute with some ideas. You can do it by making some feature requests on the issues panel, but I prefer that you make your contribution with some pull requests ;)

@@ -102,0 +102,0 @@ ## license

@@ -455,2 +455,21 @@ var device = require('../lib/device.js'),

});
https://support.google.com/webmasters/answer/1061943?hl=en
describe('76.Google Mobile (feature phone)', function () {
it('should get device type bot', function () {
var mydevice = device('SAMSUNG-SGH-E250/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Browser/6.2.3.3.c.1.101 (GUI) MMP/2.0 (compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html)');
assert.equal(mydevice.type, 'bot');
});
});
describe('77.Google Mobile (feature phone)', function () {
it('should get device type bot', function () {
var mydevice = device('DoCoMo/2.0 N905i(c100;TB;W24H16) (compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html)');
assert.equal(mydevice.type, 'bot');
});
});
describe('78.Google Smartphone', function () {
it('should get device type bot', function () {
var mydevice = device('Mozilla/5.0 (iPhone; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12F70 Safari/600.1.4 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)');
assert.equal(mydevice.type, 'bot');
});
});
describe('Bot device type check with is method', function () {

@@ -457,0 +476,0 @@ it('should get true', function () {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc