danoniplus 40.7.0-a2 → 40.7.0-a3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/js/danoni_main.js +13 -3
  2. package/package.json +1 -1
package/js/danoni_main.js CHANGED
@@ -77,8 +77,18 @@ const g_isDebug = g_isLocal ||
77
77
  getQueryParamVal(`debug`) === `true`;
78
78
  const isLocalMusicFile = _scoreId => g_isFile && !listMatching(getMusicUrl(_scoreId), [`.js`, `.txt`], { suffix: `$` });
79
79
 
80
- window.onload = async () => {
81
- await new Promise(resolve => setTimeout(resolve, 500));
80
+ const waitUntilLoaded = () => {
81
+ return new Promise(resolve => {
82
+ const checkReadyState = setInterval(() => {
83
+ if (document.readyState === 'complete') {
84
+ clearInterval(checkReadyState);
85
+ resolve();
86
+ }
87
+ }, 50); // 50msごとにチェック
88
+ });
89
+ };
90
+ (async () => {
91
+ await waitUntilLoaded();
82
92
  g_loadObj.main = true;
83
93
  g_currentPage = `initial`;
84
94
  const links = document.querySelectorAll(`link`);
@@ -91,7 +101,7 @@ window.onload = async () => {
91
101
  await loadScript2(`${g_rootPath}../js/lib/danoni_constants.js?${g_randTime}`);
92
102
  await loadScript2(`${g_rootPath}../js/lib/legacy_functions.js?${g_randTime}`, false);
93
103
  initialControl();
94
- };
104
+ })();
95
105
 
96
106
  /*-----------------------------------------------------------*/
97
107
  /* Scene : COMMON [water] */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "danoniplus",
3
- "version": "40.7.0-a2",
3
+ "version": "40.7.0-a3",
4
4
  "description": "Dancing☆Onigiri (CW Edition) - Web-based Rhythm Game",
5
5
  "main": "./js/danoni_main.js",
6
6
  "scripts": {