Page 1 of 1

'Scroll to top' rocket broken on mod portal (CORS)

Posted: Sun Nov 13, 2022 3:54 am
by coderpatsy
The rocket that you click to scroll to the top of the page is broken on mods.factorio.com. It looks to be a CORS error trying to load the script from factorio.com:
Access to script at 'https://factorio.com/static/js/factorio.js?v=c6398351' from origin 'https://mods.factorio.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
The rocket works just fine on factorio.com pages.

Re: 'Scroll to top' rocket broken on mod portal (CORS)

Posted: Mon Nov 14, 2022 9:27 am
by vinzenz
coderpatsy wrote:
Sun Nov 13, 2022 3:54 am
The rocket that you click to scroll to the top of the page is broken on mods.factorio.com. It looks to be a CORS error trying to load the script from factorio.com:
Thanks for the info, I fixed the CORS error.

Re: 'Scroll to top' rocket broken on mod portal (CORS)

Posted: Sun Mar 24, 2024 3:28 pm
by Equbuxu
bump, it's broken in the same way again

Re: 'Scroll to top' rocket broken on mod portal (CORS)

Posted: Thu Apr 04, 2024 8:01 am
by vinzenz
Equbuxu wrote:
Sun Mar 24, 2024 3:28 pm
bump, it's broken in the same way again
I'm unable to reproduce this issue in Firefox or Chrome. Can you please give me the URL of the page on which the error occurs as well as your browser?

Re: 'Scroll to top' rocket broken on mod portal (CORS)

Posted: Sun Apr 07, 2024 9:56 pm
by Equbuxu
vinzenz wrote:
Thu Apr 04, 2024 8:01 am
I'm unable to reproduce this issue in Firefox or Chrome. Can you please give me the URL of the page on which the error occurs as well as your browser?
The page I'm getting the cors error on is https://mods.factorio.com/ or any other page on the mod portal; my browser is Chromium 117.0.5938.92

I've looked into it a bit, and it indeed is browser-specific, for whatever reason, when sending a GET request to https://factorio.com/static/js/factorio.js?v=53720286 I don't always get an Access-Control-Allow-Origin header in the response:

Access-Control-Allow-Origin header is present when
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36

but absent when
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36

I've attached a minimal postman repro

overall I'm not sure if this is worth fixing as I'm using chromium (not chrome), which isn't really a popular browser, and newest chrome and firefox don't get the error

Re: 'Scroll to top' rocket broken on mod portal (CORS)

Posted: Mon Apr 08, 2024 7:39 am
by aka13
The rocket works on brave as well, no issues there.