sub2home / browser-detection Goto Github PK
View Code? Open in Web Editor NEWLightweight plugin to get information about browser, version and OS
License: MIT License
Lightweight plugin to get information about browser, version and OS
License: MIT License
When the browser user agent is different from the mentioned in the list on line 38, in my case it's Konqueror 4.5
browserParts = /(ie|firefox|chrome|safari|opera)(?:.*version)?(?:[ \/])?([\w.]+)/.exec(userAgent);
browserParts becomes null, and app fails with "Error: browserParts is null" error.the latest tag for bower represents old code still :(
I think that actually, there is no documentation about how are detected indexation robots (confirmed by scanning via google Search console on one of my websites, and displaying results)
Can you add this functionality ?
Your script is great.
Please add support IE13 and IE14 detection.
Your script determine IE13 and IE14 as Chrome 46.
IE13 UserAgent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586
IE14 UserAgent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/14.14300
I change this part in browser-detection.js:
if ( !! userAgent.match(/trident\/7\./)) {
browser = "ie";
version = 11;
} else if (browserParts && browserParts.length > 2) {
browser = browserParts[1];
version = browserParts[2];
}
with this:
if ( !! userAgent.match(/trident\/7\./)) {
browser = "ie";
version = 11;
} else if (!! userAgent.match(/edge\/13\./)) {
browser = "ie";
version = 13;
} else if(!! userAgent.match(/edge\/14\./)){
browser = "ie";
version = 14;
} else if (browserParts && browserParts.length > 2) {
browser = browserParts[1];
version = browserParts[2];
}
Thanks a lot!!!
since your bower.json doesn't have "main" property point to the js file, tools like bower-install or wiredep cannot inject that dependency into the index.html.
Also please update the bower with that fix :)
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/601.3.9 (KHTML, like Gecko) Version/9.0.2 Safari/601.3.9"
{browser: "safari", version: 601, os: "osx"}
The bower repo still has version with missing comma :(
Cuz its not chrome :)
http://stackoverflow.com/questions/9286355/how-to-detect-only-the-native-android-browser
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.