diff --git a/modules/ui.py b/modules/ui.py
index 036f2ed3a..cbdbfe74a 100644
--- a/modules/ui.py
+++ b/modules/ui.py
@@ -1019,7 +1019,7 @@ with open(os.path.join(script_path, "script.js"), "r", encoding="utf8") as jsfil
javascript = f''
jsdir = os.path.join(script_path, "javascript")
-for filename in os.listdir(jsdir):
+for filename in sorted(os.listdir(jsdir)):
with open(os.path.join(jsdir, filename), "r", encoding="utf8") as jsfile:
javascript += f"\n"