Skip to content

Instantly share code, notes, and snippets.

@alevgenk
Created May 28, 2024 14:05
Show Gist options
  • Save alevgenk/98067583379354637c4c5d509f3c8c6d to your computer and use it in GitHub Desktop.
Save alevgenk/98067583379354637c4c5d509f3c8c6d to your computer and use it in GitHub Desktop.
Get some browser detail
let getMyBrowserDetails = async () => {
async function myIP() {
let response = await fetch("https://api.db-ip.com/v2/free/self");
return await response.json()
}
const ipData = await myIP()
return {
ip: ipData.ipAddress,
accept_header: "*/*",
java_enabled: navigator.javaEnabled(),
language: navigator.language,
color_depth: screen.colorDepth,
screen_height: screen.height,
screen_width: screen.width,
window_height: document.body.clientHeight,
window_width: document.body.clientWidth,
time_zone_offset: new Date().getTimezoneOffset(),
time_zone_name: Intl.DateTimeFormat().resolvedOptions().timeZone,
user_agent: navigator.userAgent,
}
}
console.table(
await getMyBrowserDetails()
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment