Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds ChromeOS detection, epiphany browser, and "Chromebook" device model #49

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
14 changes: 13 additions & 1 deletion dist/detectizr.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Written by Baris Aydinoglu (http://baris.aydinoglu.info) - Copyright 2012
* Released under the MIT license
*
* Date: 2016-06-10T11:58Z
* Date: 2016-07-26T13:38Z
*/
window.Detectizr = (function(window, navigator, document, undefined) {
var Detectizr = {},
Expand Down Expand Up @@ -292,6 +292,7 @@ window.Detectizr = (function(window, navigator, document, undefined) {
} else if (test(/cros/)) {
// Check if user agent is a Chromebook
device.type = deviceTypes[3];
device.model = "chromebook";
} else if (test(/bot|crawler|spider|yahoo|ia_archiver|covario-ids|findlinks|dataparksearch|larbin|mediapartners-google|ng-search|snappy|teoma|jeeves|tineye/) && !test(/mobile/)) {
// Check if user agent is a Desktop BOT/Crawler/Spider
device.type = deviceTypes[3];
Expand Down Expand Up @@ -396,6 +397,8 @@ window.Detectizr = (function(window, navigator, document, undefined) {
}
} else if (is("webtv")) {
os.name = "webtv";
} else if (is("x11") && test(/cros/)) {
os.name ="chromeos";
} else if (is("x11") || is("inux")) {
os.name = "linux";
} else if (is("sunos")) {
Expand Down Expand Up @@ -438,6 +441,9 @@ window.Detectizr = (function(window, navigator, document, undefined) {
} else {
setVersion(browser, (test(/trident\/4\.0/) ? "8" : RegExp.$1));
}
} else if (test(/iceweasel/)){
browser.name = "iceweasel";
browser.engine = "gecko";
} else if (is("firefox")) {
browser.engine = "gecko";
browser.name = "firefox";
Expand All @@ -458,13 +464,19 @@ window.Detectizr = (function(window, navigator, document, undefined) {
browser.engine = "webkit";
browser.name = "chrome";
setVersion(browser, (test(/chrome\/([\d\.]+)/) ? RegExp.$1 : ""));
} else if (test(/epiphany/)) {
browser.name = "epiphany";
browser.engine = "webkitgtk";
} else if (is("iron")) {
browser.engine = "webkit";
browser.name = "iron";
} else if (is("crios")) {
browser.name = "chrome";
browser.engine = "webkit";
setVersion(browser, (test(/crios\/([\d\.]+)/) ? RegExp.$1 : ""));
} else if (test(/midori/)) {
browser.name = "midori";
browser.engine = "webkit";
} else if (is("applewebkit/")) {
browser.name = "safari";
browser.engine = "webkit";
Expand Down
2 changes: 1 addition & 1 deletion dist/detectizr.min.js

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

Loading