fix entry abs path load input, not working in cloud gpu

This commit is contained in:
Weixuan Fu
2024-03-12 16:10:25 +08:00
parent 1130030754
commit dee8846a80
+2 -1
View File
@@ -2,6 +2,7 @@ const targetNode = document.body;
// Options for the observer (which mutations to observe)
const config = { childList: true, subtree: true };
const api_base = window.location.pathname.split("/").slice(0, -1).join("/");
// @ts-ignore
const callback = function (mutationsList, observer) {
@@ -11,7 +12,7 @@ const callback = function (mutationsList, observer) {
mutation.addedNodes.forEach((node) => {
if (node.nodeName === "CANVAS") {
// @ts-ignore
import("/workspace_web/input.js");
import(api_base + "/workspace_web/input.js");
observer.disconnect();
}
});