-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.php
More file actions
54 lines (49 loc) · 1.59 KB
/
index.php
File metadata and controls
54 lines (49 loc) · 1.59 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php $config = require 'config.php'; ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>QR Scan</title>
</head>
<body>
<script>
const CONFIG = {
redirectUrl: <?php echo json_encode($config['redirectUrl']); ?>
};
function getDeviceInformation() {
const deviceInfo = {
deviceType: /Android|iPhone|iPad|iPod|IEMobile/i.test(navigator.userAgent) ? 'Mobile' : 'Desktop',
operatingSystem: navigator.platform,
browserVersion: navigator.userAgent,
gpu: getGPUInfo(),
screenResolution: `${screen.width}x${screen.height}`,
platform: navigator.platform,
referrer: document.referrer || 'Unknown'
};
return deviceInfo;
}
function getGPUInfo() {
try {
const canvas = document.createElement('canvas');
const gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
if (!gl) return 'N/A';
const debugInfo = gl.getExtension('WEBGL_debug_renderer_info');
return debugInfo ? gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL) : 'N/A';
} catch (e) {
return 'N/A';
}
}
function sendDeviceInfo() {
const deviceInfo = getDeviceInformation();
fetch('info.php', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify(deviceInfo)
}).finally(() => {
window.location.href = CONFIG.redirectUrl;
});
}
sendDeviceInfo();
</script>
</body>
</html>