-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
2,580 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,49 @@ | ||
function getsysInfo(sysInfo) { | ||
if (sysInfo) { | ||
return sysInfo; | ||
} else { | ||
return require("./sysInfo").get(); | ||
} | ||
if (sysInfo) { | ||
return sysInfo; | ||
} | ||
return require('./sys-info')(); | ||
} | ||
|
||
function chrome(version, sysInfo) { | ||
return 'Mozilla/5.0 (' + getsysInfo(sysInfo) + ') AppleWebKit/537.36 (KHTML, like Gecko) Chrome/' + version + ' Safari/537.36'; | ||
} | ||
|
||
function chromeAdvanced(version, webkitVersion, sysInfo) { | ||
return 'Mozilla/5.0 (' + getsysInfo(sysInfo) + ') AppleWebKit/' + webkitVersion + ' (KHTML, like Gecko) Chrome/' + version + ' Safari/' + webkitVersion; | ||
} | ||
|
||
function firefox(version, sysInfo) { | ||
return 'Mozilla/5.0 (' + getsysInfo(sysInfo) + '; rv:' + version + ') Gecko/20100101 Firefox/' + version; | ||
} | ||
|
||
function firefoxAdvanced(version, geckoVersion, sysInfo) { | ||
return 'Mozilla/5.0 (' + getsysInfo(sysInfo) + '; rv:' + version + ') Gecko/' + geckoVersion + ' Firefox/' + version; | ||
} | ||
|
||
function opera(version, sysInfo) { | ||
return 'Opera/9.80 (' + getsysInfo(sysInfo) + ') Presto/2.12.388 Version/' + version; | ||
} | ||
|
||
function operaAdvanced(version, prestoVersion, operaVersion, sysInfo) { | ||
return 'Opera/' + operaVersion + ' (' + getsysInfo(sysInfo) + ') Presto/' + prestoVersion + ' Version/' + version; | ||
} | ||
|
||
function safari(version, sysInfo) { | ||
return 'Mozilla/5.0 (' + getsysInfo(sysInfo) + ') AppleWebKit/601.4.8 (KHTML, like Gecko) Version/' + version + ' Safari/601.4.8'; | ||
} | ||
|
||
function safariAdvanced(version, webkitBuildVersion, safariBuildVersion, sysInfo) { | ||
return 'Mozilla/5.0 (' + getsysInfo(sysInfo) + ') AppleWebKit/' + webkitBuildVersion + ' (KHTML, like Gecko) Version/' + version + ' Safari/' + safariBuildVersion; | ||
} | ||
|
||
module.exports = { | ||
chrome: function chrome(version, sysInfo) { | ||
return "Mozilla/5.0" + " (" + getsysInfo(sysInfo) + ")" + " AppleWebKit/537.36 (KHTML, like Gecko) Chrome/" + version + " Safari/537.36"; | ||
}, | ||
chromeAdvanced: function chromeAdvanced(version, webkitVersion, sysInfo) { | ||
return "Mozilla/5.0" + " (" + getsysInfo(sysInfo) + ")" + " AppleWebKit/" + webkitVersion + " (KHTML, like Gecko) Chrome/" + version + " Safari/" + webkitVersion; | ||
}, | ||
firefox: function firefox(version, sysInfo) { | ||
return "Mozilla/5.0" + " (" + getsysInfo(sysInfo) + "; rv:" + version + ")" + " Gecko/20100101 Firefox/" + version; | ||
}, | ||
firefoxAdvanced: function firefoxAdvanced(version, geckoVersion, sysInfo) { | ||
return "Mozilla/5.0" + " (" + getsysInfo(sysInfo) + "; rv:" + version + ")" + " Gecko/" + geckoVersion + " Firefox/" + version; | ||
}, | ||
opera: function opera(version, sysInfo) { | ||
return "Opera/9.80 (" + getsysInfo(sysInfo) + ") Presto/2.12.388 Version/" + version; | ||
}, | ||
operaAdvanced: function operaAdvanced(version, prestoVersion, operaVersion, sysInfo) { | ||
return "Opera/" + operaVersion + " (" + getsysInfo(sysInfo) + ") Presto/" + prestoVersion + " Version/" + version; | ||
}, | ||
safari: function safari(version, sysInfo) { | ||
return "Mozilla/5.0 (" + getsysInfo(sysInfo) + ") AppleWebKit/601.4.8 (KHTML, like Gecko) Version/" + version + " Safari/601.4.8"; | ||
}, | ||
safariAdvanced: function safariAdvanced(version, webkitBuildVersion, safariBuildVersion, sysInfo) { | ||
return "Mozilla/5.0 (" + getsysInfo(sysInfo) + ") AppleWebKit/" + webkitBuildVersion + " (KHTML, like Gecko) Version/" + version + " Safari/" + safariBuildVersion; | ||
} | ||
chrome, | ||
chromeAdvanced, | ||
firefox, | ||
firefoxAdvanced, | ||
opera, | ||
operaAdvanced, | ||
safari, | ||
safariAdvanced | ||
}; |
Oops, something went wrong.