I am trying to send a XMLHttpRequest to assetgame.roblox.com
, while executing this script on roblox.com
. I got this information by using "Web Sniffer", seeing that when I click on a button, the javascript on the page itself makes a request to assetgame.roblox.com
. But when I try to mimic this request using javascript, and then executing it using console, it gives me a CORS error:
Access to XMLHttpRequest at 'https://www.roblox.com/request-error?id=fd7cb667-7a45-4663-afb5-55b055968f71&mode=&code=' (redirected from 'https://assetgame.roblox.com/game/report-event') from origin 'null' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
My script:
var b = new XMLHttpRequest();
b.open("POST", "https://assetgame.roblox.com/game/report-event", true);
b.setRequestHeader("Accept", "*/*");
b.setRequestHeader("X-CSRF-TOKEN", token);
b.send("name=GameLaunchAttempt_Win32");
I would be very thankfull if someone could help me with this case. Thank you.