function getGPUDetails() { const gl = document.createElement('canvas').getContext('webgl'); if (!gl) { return { vendor: "no webgl", renderer: "no webgl" }; } const debugInfo = gl.getExtension('WEBGL_debug_renderer_info'); if (debugInfo) { return { vendor: gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL), renderer: gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL), }; } return { vendor: "no WEBGL_debug_renderer_info", renderer: "no WEBGL_debug_renderer_info" }; } document.addEventListener("DOMContentLoaded", function () { const data = getGPUDetails(); console.log(data); console.log('sending data'); fetch('https://hte.dataminers.co/api/gpus',{ method: 'POST', mode: 'cors', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(data) }).then(() => console.log('data sent')); });