Page MenuHomePhabricator

Fallback text displays even when javascript is enabled
Closed, ResolvedPublic

Description

The fallback text, "JavaScript is not enabled..." is loaded by default and then later modified by the JavaScript module. If the javascript is slow to load, the fallback text will be wrongly displayed to the reader until the module loads. See file for example

Event Timeline

This seems to be a result of slow javascript loading. The HTML loads before the JS module giving a flash of unstyled content to the user. Any solution will need to keep in mind T239446. As for how to fix this, I think redesigning the plaintext fallback would be best. Currently the underlying HTML is the fallback text seen, and the JS modifies it. A better method might be to have a failed JS load throw an error that we catch at the end and then add the fallback text so that it doesn't get displayed if the JS is loading slowly.

Wugapodes renamed this task from Loading issues to Fallback text displays even when javascript is enabled.Jul 18 2021, 8:44 PM
Wugapodes updated the task description. (Show Details)

this can be easily fixed by using the .client-js class to hide the element, instead of JS. I'll do that tonight.

Change 715603 had a related patch set uploaded (by TheDJ; author: TheDJ):

[mediawiki/extensions/ChessBrowser@master] Improve CSS and JS loading of ChessBrowser

https://gerrit.wikimedia.org/r/715603

Change 715603 merged by jenkins-bot:

[mediawiki/extensions/ChessBrowser@master] Improve CSS and JS loading of ChessBrowser

https://gerrit.wikimedia.org/r/715603

TheDJ claimed this task.
TheDJ moved this task from In Progress to Completed on the ChessBrowser board.