From e35dd5a0281c511320c44291a400b7374a0659b0 Mon Sep 17 00:00:00 2001 From: tza Date: Thu, 7 Apr 2022 23:22:23 +0300 Subject: plugin menu title change bug Fixed a bug where steam would sometimes fire message events on its own, causing them to be displayed as plugin titles. --- plugin_loader/static/plugin_page.js | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'plugin_loader/static/plugin_page.js') diff --git a/plugin_loader/static/plugin_page.js b/plugin_loader/static/plugin_page.js index 49d1aa89..b9a089a8 100644 --- a/plugin_loader/static/plugin_page.js +++ b/plugin_loader/static/plugin_page.js @@ -1,12 +1,3 @@ -function setPluginName(name) { - document.getElementById("plugin_title").innerHTML = ` - - - - ${name} - `; -} - function reloadIframe() { document.getElementById("plugin_iframe").contentWindow.location.href = "http://127.0.0.1:1337/plugins/iframe"; } @@ -83,12 +74,15 @@ function addPluginInstallPrompt(artifact, version, request_id) { document.getElementById("plugin_title").innerText = "Plugins"; } window.onmessage = function(ev) { - document.getElementById("plugin_title").innerHTML = ` - - - - ${ev.data} - `; + let title = ev.data; + if (title.startsWith("PLUGIN_LOADER__")) { + document.getElementById("plugin_title").innerHTML = ` + + + + ${title} + `; + } } clearInterval(injector); } -- cgit v1.2.3