Skip to content

Commit

Permalink
Fix safari and add keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
fscherwi committed Feb 25, 2017
1 parent 220e40e commit 83c12b8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module.exports = {
safari: function safari(version, sys_info) {
return 'Mozilla/5.0 (' + get_sys_info(sys_info) + ') AppleWebKit/601.4.4 (KHTML, like Gecko) Version/' + version + ' Safari/601.4.4';
},
safari_advanced: function safari_advanced(version, sys_info, webkit_build_version, safari_build_version) {
safari_advanced: function safari_advanced(version, webkit_build_version, safari_build_version, sys_info) {
return 'Mozilla/5.0 (' + get_sys_info(sys_info) + ') AppleWebKit/' + webkit_build_version + ' (KHTML, like Gecko) Version/' + version + ' Safari/' + safari_build_version;
}
};
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@
"url": "git+https://github.com/fscherwi/get-user-agent.git"
},
"keywords": [
"useragent"
"useragent",
"user-agent",
"browser",
"firefox",
"chrome",
"opera",
"safari"
],
"author": "fscherwi",
"license": "MIT",
Expand All @@ -29,6 +35,8 @@
"uglify-js": "^2.7.5"
},
"files": [
"README.md",
"LICENSE",
"main.js"
]
}
6 changes: 3 additions & 3 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ var agents = [
useragent.firefox_advanced(version = '41.0', gecko_version = '20100101'),
useragent.opera('12.6'),
useragent.opera_advanced(version = '12.6', presto_version = '2.12.388', opera_version = '9.80'),
useragent.safari('9.0.3'),
useragent.safari_advanced(version='9.0.3', webkit_build_version='601.4.4', safari_build_version='601.4.4')
useragent.safari('10.0.3'),
useragent.safari_advanced(version='10.0.3', webkit_build_version='602.4.8', safari_build_version='602.4.8')
];
agents.forEach(function(user_agent) {
console.log('%s (%s): %s', parser.parse(user_agent).ua.toString(), parser.parse(user_agent).os.toString(), user_agent);
console.log('%s (%s):\t %s', parser.parse(user_agent).ua.toString(), parser.parse(user_agent).os.toString(), user_agent);
});
console.log('');

0 comments on commit 83c12b8

Please sign in to comment.