You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use setFileHandler to serve a .js file for a <script src="test.js"> in my WebUI window.
Scenario 1:
const win = new WebUI();
win.show(myhtml);
win.setFileHandler(myCallback);
Outcome:
The window opens and attempts to load test.js before setFileHandler starts serving, leading to a 404.
Scenario 2:
const win = new WebUI();
win.setFileHandler(myCallback);
win.show(myhtml);
Outcome:
The window opens and during it's initialization where it needs to load the built-in webui.js then setFileHandler blocks that requests and does not serve webui.js so the window never successfully initializes.
I suggest that setFileHandler be changed to have a hardcoded exception for webui.js so that it will not intercept that request and allow the window initialization proceed as normal. It's possible that the same happens with favicon.svg but I have not tested.
Edit: I tried serving a copy of webui.js myself in setFileHandler but the window still fails to initialize, so my diagnosis might not be 100% accurate. I can at least confirm that loading test.js inside a setTimeout so that there is a delay makes it successfully load from setFileHandler
The text was updated successfully, but these errors were encountered:
I'm trying to use setFileHandler to serve a .js file for a
<script src="test.js">
in my WebUI window.Scenario 1:
Scenario 2:
I suggest that
setFileHandler
be changed to have a hardcoded exception forwebui.js
so that it will not intercept that request and allow the window initialization proceed as normal. It's possible that the same happens withfavicon.svg
but I have not tested.Edit: I tried serving a copy of
webui.js
myself insetFileHandler
but the window still fails to initialize, so my diagnosis might not be 100% accurate. I can at least confirm that loadingtest.js
inside asetTimeout
so that there is a delay makes it successfully load fromsetFileHandler
The text was updated successfully, but these errors were encountered: