Skip to content

Commit ae37ea0

Browse files
authored
chore: enhance release selector options and improve initialization logic (#16)
1 parent 206820f commit ae37ea0

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

docs/javascripts/release-selector.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ class ReleaseSelector {
1010
macos: "macOS",
1111
android: "Android",
1212
ios: "iOS",
13-
"web-no": "Web (No Threads)",
14-
"web-yes": "Web (With Threads)",
13+
"web-nothreads": "Web (No Threads, No extension support)",
14+
"web-dlink-nothreads": "Web (No Threads, With extension support)",
15+
"web-dlink": "Web (With Threads, With extension support)",
16+
web: "Web (With Threads, No extension support)",
1517
};
1618

1719
this.engines = {
@@ -414,7 +416,11 @@ class ReleaseSelector {
414416
}
415417
}
416418

417-
// Initialize when DOM is loaded
418-
document.addEventListener("DOMContentLoaded", () => {
419+
// Initialize when DOM is loaded or immediately if already loaded
420+
if (document.readyState === "loading") {
421+
document.addEventListener("DOMContentLoaded", () => {
422+
new ReleaseSelector();
423+
});
424+
} else {
419425
new ReleaseSelector();
420-
});
426+
}

0 commit comments

Comments
 (0)