fix(frontend): Safariでプラグインが複数ある場合に正常に読み込まれない問題を修正 #10290
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Plugin:register_post_form_action
を使用したプラグインを公開した際に、Safariを使用している方々から「1つは反映されているがプラグインが反映されていない」との報告を受けたため、Safariでも正常にプラグインが読み込めるように修正しました。同様のissueが #9829 にありました。
Why
#9829 の問題を調べた結果、createAiScriptEnvで
ReferenceError: Cannot access uninitialized variable
が発生しており、それに関連した他のissue( sveltejs/kit#2889 sveltejs/kit#7805 )からwebkitのバグが問題であるらしく、ロード時に同時に読み込もうとすると起こるバグのようなので、import
の処理の開始を少し遅らせることによって問題が解決した。setTimeout
の値が0の場合でも読み込まれていたので、読み込み速度にあまり影響が出ないようにしてあります。Additional info (optional)
Checklist