diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/pwa/index.html')
-rw-r--r-- | packages/taler-wallet-webextension/src/pwa/index.html | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/packages/taler-wallet-webextension/src/pwa/index.html b/packages/taler-wallet-webextension/src/pwa/index.html new file mode 100644 index 000000000..c150ee68d --- /dev/null +++ b/packages/taler-wallet-webextension/src/pwa/index.html @@ -0,0 +1,114 @@ +<html> + <head> + <meta charset="utf-8" /> + <link rel="manifest" href="./manifest.json" /> + <style> + .overlay { + position: absolute; + top: 0px; + display: none; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); + color: white; + justify-content: center; + } + .overlay > iframe { + margin: auto; + } + </style> + </head> + <body> + <script> + function openPopup() { + document.getElementById("popup-overlay").style.display = "flex"; + window.frames["popup"].location = "popup.html"; + } + function closePopup() { + document.getElementById("popup-overlay").style.display = "none"; + } + function redirectWallet(url) { + window.frames["wallet"].location = url; + } + function openWallet() { + redirectWallet("wallet.html"); + } + function closeWallet() { + redirectWallet("about:blank"); + } + function reloadWallet() { + window.frames["wallet"].location.reload() + } + function openPage() { + window.frames["other"].location = + document.getElementById("page-url").value; + } + </script> + <button value="asd" onclick="openPopup()">open popup</button> + <button value="asd" onclick="closeWallet();openWallet()"> + restart + </button> + <button value="asd" onclick="reloadWallet()"> + refresh + </button> + <br /> + <iframe + id="wallet-window" + name="wallet" + src="wallet.html" + style="height: calc(100% - 30px)" + width="850" + height="90%" + > + </iframe> + <!-- <input id="page-url" type="text" /> + <button onclick="openPage()">open</button> --> + <!-- <a + href='javascript:void(window.frames["other"].location = "http://bank.taler:5882")' + >open local bank</a + > + <hr /> + <iframe + id="other-window" + name="other" + src="http://bank.taler:5882" + width="100%" + height="325" + > + </iframe> --> + <div class="overlay" id="popup-overlay" onclick="closePopup()"> + + <iframe + id="popup-window" + name="popup" + src="about:blank" + width="500" + height="325" + > + </iframe> + </div> + <!-- <hr /> + <iframe src="tests.html" name="wallet" width="800" height="100%"> </iframe> --> + <!-- <hr /> + <iframe src="stories.html" name="wallet" width="800" height="100%"> --> + <script type="module" src="background.dev.js"></script> + <script type="module"> + if ("serviceWorker" in navigator) { + try { + const registration = await navigator.serviceWorker.register("sw.js", { + scope: "/app/", + }); + if (registration.installing) { + console.log("Service worker installing"); + } else if (registration.waiting) { + console.log("Service worker installed"); + } else if (registration.active) { + console.log("Service worker active"); + } + } catch (error) { + console.error(`Registration failed with ${error}`); + } + } + </script> + </body> +</html> |