Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firefox Issue with Darkmode, prevents page load #139

Open
kaiden11 opened this issue Jun 9, 2024 · 5 comments
Open

Firefox Issue with Darkmode, prevents page load #139

kaiden11 opened this issue Jun 9, 2024 · 5 comments

Comments

@kaiden11
Copy link

kaiden11 commented Jun 9, 2024

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:

  1. Run docker run:

    docker run --name openspeedtest -p 3000:3000 -p 3001:3001 openspeedtest/latest
    
  2. Open http://localhost:3000/

  3. 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).

@openspeedtest
Copy link
Owner

Unable to reproduce this on my M1 Mac with Firefox 126.0.1 (64-bit). What are your Firefox version and OS?

@kaiden11
Copy link
Author

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).

@kaiden11
Copy link
Author

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.

@jorsol
Copy link

jorsol commented Jun 12, 2024

I have the same issue running with Firefox/126.0 on Fedora 40
Screenshot from 2024-06-12 17-02-13

BTW, the issue happens even on the public https://openspeedtest.com/ website but without the nightMode is null error.

@jorsol
Copy link

jorsol commented Jun 12, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants