Firefox Issue with Darkmode, prevents page load
Versions:
- Firefox: 126.0
- Chrome: 119.0
Description: Upon attempting to detect dark mode during page load, Firefox attempts to operate on the non-existent id=darkmode element in the <head>.
Steps to reproduce:
-
Run
docker run:docker run --name openspeedtest -p 3000:3000 -p 3001:3001 openspeedtest/latest -
Observe a blank window (failed page load), with the following in the browser console:
OpenSpeedTest.com V2.5.4 Loaded! localhost:3000:131:15
Now Press the Start Button or HIT Enter. localhost:3000:132:15
The secret to living happy is giving happiness. Have a wonderful day. localhost:3000:133:15
Uncaught TypeError: c is null
addEvt http://localhost:3000/assets/js/app-2.5.4.min.js line 8 > srcScript:30
jb http://localhost:3000/assets/js/app-2.5.4.min.js line 8 > srcScript:44
Start http://localhost:3000/assets/js/app-2.5.4.min.js line 8 > srcScript:51
onload http://localhost:3000/assets/js/app-2.5.4.min.js line 8 > srcScript:9
EventHandlerNonNull* http://localhost:3000/assets/js/app-2.5.4.min.js line 8 > srcScript:9
app-2.5.4.min.js line 8 > srcScript:30:282
Uncaught TypeError: nightMode is null
changeSkin http://localhost:3000/assets/js/darkmode.js:2
EventListener.handleEvent* http://localhost:3000/assets/js/darkmode.js:1
darkmode.js:2:247
Attempting the same page load with Chrome does not exhibit this issue.
There does not appear to be a 'mode' cookie that would indicate a previous detection of dark mode. The 'matchMedia' handling in the <head> script does not appear to fail, but later reference to the darkmode element prevents further page load (and results in no interface presented in Firefox).
Unable to reproduce this on my M1 Mac with Firefox 126.0.1 (64-bit). What are your Firefox version and OS?
Versions:
- Firefox: 126.0+build2-0ubuntu0.22.04.1~mt1 (and 64-bit, according to
apt list) - OS: Ubuntu 22.04.4 LTS (according to
lsb_release -a).
For what it's worth, I'm finding that when I check out the main branch for openspeedtest, and volume mount those files into an HTTP serving container, I am able to get the proper openspeedtest UI.
Example docker-compose.yml:
version: '3'
services:
app:
image: halverneus/static-file-server:latest
environment:
- "FOLDER=/web"
- "DEBUG=1"
- "PORT=8080"
ports:
- 8080:8080
volumes:
# , the current directory being the openspeedtest repo, latest commit on main
- ".:/web:ro"
It seems that the issue is only present so far with the openspeedtest/latest:latest image from Dockerhub.
I have the same issue running with Firefox/126.0 on Fedora 40
BTW, the issue happens even on the public https://openspeedtest.com/ website but without the nightMode is null error.
Checking more closely, the issue only happens with the NoScript Firefox extension even having the site as TRUSTED, I need to completely disable the extension to make the site work.
I have the same or similar issue on Firefox.. I am not using NoScript though.
I think the issue might be related to Firefox privacy settings. I basically have them on CUSTOM that result in STRICT.
When with anonymous window without extensions:
@SpiReCZ SVG not loaded? Maybe try this https://github.com/openspeedtest/Speed-Test/pull/137