diff options
| author | tza <marios8543@gmail.com> | 2022-04-04 20:46:35 +0300 |
|---|---|---|
| committer | tza <marios8543@gmail.com> | 2022-04-04 20:46:35 +0300 |
| commit | 8d0fe5c45ac67ea4eef9a7c6a5e4eaaa57ad01d3 (patch) | |
| tree | b7f966d50db684ef51736d78da76c966a92e4563 /plugin_loader/static | |
| parent | 1d4100fabb7f70eaf1c653f5fd0647c20aa71a63 (diff) | |
| download | decky-loader-8d0fe5c45ac67ea4eef9a7c6a5e4eaaa57ad01d3.tar.gz decky-loader-8d0fe5c45ac67ea4eef9a7c6a5e4eaaa57ad01d3.zip | |
hot reload now refreshes iframe
also fixed fetch_nocors
Diffstat (limited to 'plugin_loader/static')
| -rw-r--r-- | plugin_loader/static/library.js | 3 | ||||
| -rw-r--r-- | plugin_loader/static/plugin_page.js | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/plugin_loader/static/library.js b/plugin_loader/static/library.js index 1e35eee6..05e08ff2 100644 --- a/plugin_loader/static/library.js +++ b/plugin_loader/static/library.js @@ -2,7 +2,6 @@ class PluginEventTarget extends EventTarget { } method_call_ev_target = new PluginEventTarget(); window.addEventListener("message", function(evt) { - console.log(evt); let ev = new Event(evt.data.call_id); ev.data = evt.data.result; method_call_ev_target.dispatchEvent(ev); @@ -27,6 +26,8 @@ async function fetch_nocors(url, request={}) { let args = { method: "POST", headers: {}, body: "" }; request = {...args, ...request}; request.url = url; + request.data = request.body; + delete request.body; //maintain api-compatibility with fetch return await call_server_method("http_request", request); } diff --git a/plugin_loader/static/plugin_page.js b/plugin_loader/static/plugin_page.js index c58188db..b42cd711 100644 --- a/plugin_loader/static/plugin_page.js +++ b/plugin_loader/static/plugin_page.js @@ -38,6 +38,11 @@ }, 100); })(); +function reloadIframe() { + console.log("reloading iframe"); + document.getElementById("plugin_iframe").contentWindow.location.href = "http://127.0.0.1:1337/plugins/iframe"; +} + function resolveMethodCall(call_id, result) { let iframe = document.getElementById("plugin_iframe").contentWindow; iframe.postMessage({'call_id': call_id, 'result': result}, "http://127.0.0.1:1337"); |
