diff options
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"); |
