-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevice_info.html
More file actions
36 lines (34 loc) · 1.04 KB
/
Copy pathdevice_info.html
File metadata and controls
36 lines (34 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!DOCTYPE html>
<html>
<head><title>Device Info</title>
<style>
body { background: #111; color: #eee; font-family: sans-serif; padding: 20px; }
h2 { color: #0f0; }
</style>
</head>
<body>
<h2>Device Information</h2>
<div id="info">Loading...</div>
<script>
async function getInfo() {
let info = "";
info += "User Agent: " + navigator.userAgent + "<br>";
info += "Language: " + navigator.language + "<br>";
info += "Platform: " + navigator.platform + "<br>";
info += "Battery: Loading...<br>";
info += "IP Address: (Use real API)<br>";
document.getElementById("info").innerHTML = info;
if (navigator.getBattery) {
const battery = await navigator.getBattery();
document.getElementById("info").innerHTML += "Battery Level: " + Math.round(battery.level * 100) + "%<br>";
}
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(pos => {
document.getElementById("info").innerHTML += "Location: Lat " + pos.coords.latitude + ", Long " + pos.coords.longitude + "<br>";
});
}
}
getInfo();
</script>
</body>
</html>