diff --git a/app/server.js b/app/server.js index 31ec187..5e3dd9f 100644 --- a/app/server.js +++ b/app/server.js @@ -103,9 +103,13 @@ function config() { } function startWorker() { - if (myWorker) { + if (myWorker || sessionStorage.getItem("server")) { + alert('Another server is already running. Only one server can run at a time.'); return; + } else { + sessionStorage.setItem("server", "live"); } + myWorker = new Worker("app/bg-worker.js"); // Register handler for messages from the background worker @@ -146,6 +150,7 @@ function stopWorker() { } myWorker.terminate(); myWorker = null; + sessionStorage.removeItem("server"); console.log("Worker terminated"); toggleServer.value = "Launch Server" logThis("Server stopped"); diff --git a/index.html b/index.html index 36ed78e..2ee8cec 100755 --- a/index.html +++ b/index.html @@ -50,11 +50,11 @@
<!-- Replace XXXXX with the form action URL given by this app upon sign up` -->
-<form action="XXXXX" method="POST" target="hidden_iframe" autocomplete="on">
+<form action="XXXXX" method="POST" target="hidden_iframe">
<input type="hidden" name="From" value="sample">
<input type="email" name="Email" placeholder="Your Email">
<input type="text" name="Name" placeholder="Your Name">
- <input type="text" name="Message" placeholder="Your Message" autocomplete="off">
+ <input type="text" name="Message" placeholder="Your Message">
<button type="submit">Submit<button>
<input type="reset">Reset<button>
</form>
@@ -102,7 +102,9 @@ Setup
Server
- Test if everything is working properly with the following sample form. You should get a Telegram message upon clicking Post! Your posted data should also be logged below.
+ Test if everything is working properly with the following sample form (embed in your own website with
+ ). You should get a Telegram message upon clicking Post! Your posted data
+ should also be logged below.