mirror of
https://github.com/github/codeql-action.git
synced 2026-05-17 08:40:16 +00:00
Initial commit
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
export function getUserAgent() {
|
||||
try {
|
||||
return navigator.userAgent;
|
||||
}
|
||||
catch (e) {
|
||||
return "<environment undetectable>";
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { getUserAgent } from "./node";
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
import osName from "os-name";
|
||||
export function getUserAgent() {
|
||||
try {
|
||||
return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
|
||||
}
|
||||
catch (error) {
|
||||
if (/wmic os get Caption/.test(error.message)) {
|
||||
return "Windows <version undetectable>";
|
||||
}
|
||||
return "<environment undetectable>";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user