from spa to pwa

This commit is contained in:
Sebastian 2023-06-02 14:25:33 -03:00
parent e3ec395b35
commit 9853f54201
No known key found for this signature in database
GPG Key ID: 173909D1A5F66069
21 changed files with 58 additions and 91 deletions

View File

@ -85,6 +85,25 @@ justify-content: center;
<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>
</body>
<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>

View File

@ -0,0 +1,31 @@
{
"name": "GNU Taler Wallet",
"description": "Privacy preserving and transparent payments",
"author": "GNU Taler Developers",
"version": "0.9.3.13",
"id": "gnu-taler-wallet-web-spa-development",
"version_name": "0.9.3-dev.13",
"display": "minimal-ui",
"start_url": "./",
"manifest_version": 3,
"minimum_chrome_version": "88",
"icons": [{
"src": "./static/img/taler-logo-48.png",
"type": "image/png",
"sizes": "48x48"
},{
"src": "./static/img/taler-logo-128.png",
"type": "image/png",
"sizes": "128x128"
},{
"src": "./static/img/taler-logo-512.png",
"type": "image/png",
"sizes": "512x512"
}],
"protocol_handlers": [
{
"protocol": "web+taler",
"url": "./wallet.html?type=%s"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

@ -0,0 +1,6 @@
console.log("sw: Service worker installed");
self.addEventListener("fetch", (event) => {
// console.log("fetch event", event);
// event.respondWith(/* custom content goes here */);
});

View File

@ -1,78 +0,0 @@
{
"name": "GNU Taler Wallet",
"description": "Privacy preserving and transparent payments",
"author": "GNU Taler Developers",
"version": "0.9.3.13",
"id": "gnu-taler-wallet-web-spa-development",
"version_name": "0.9.3-dev.13",
"icons": [{
"src": "static/img/taler-logo-48.png",
"sizes": "48x48"
},{
"src": "static/img/taler-logo-128.png",
"sizes": "128x128"
}],
"display": "minimal-ui",
"start_url": "http://localhost:8080/app/index.html",
"manifest_version": 3,
"minimum_chrome_version": "88",
"permissions": [
"unlimitedStorage",
"storage",
"activeTab",
"scripting",
"declarativeContent",
"alarms"
],
"commands": {
"_execute_action": {
"suggested_key": {
"default": "Alt+W"
}
}
},
"content_scripts": [
{
"id": "taler-wallet-interaction",
"matches": [
"file://*/*",
"http://*/*",
"https://*/*"
],
"js": [
"dist/taler-wallet-interaction-loader.js"
]
}
],
"web_accessible_resources": [
{
"resources": [
"static/wallet.html",
"dist/taler-wallet-interaction-loader.js.map",
"dist/taler-wallet-interaction-loader.js",
"dist/taler-wallet-interaction-support.js.map",
"dist/taler-wallet-interaction-support.js"
],
"matches": [
"https://*/*",
"http://*/*",
"file://*/*"
]
}
],
"action": {
"default_icon": {
"16": "static/img/taler-logo-16.png",
"19": "static/img/taler-logo-19.png",
"32": "static/img/taler-logo-32.png",
"38": "static/img/taler-logo-38.png",
"48": "static/img/taler-logo-48.png",
"64": "static/img/taler-logo-64.png",
"128": "static/img/taler-logo-128.png",
"256": "static/img/taler-logo-256.png",
"512": "static/img/taler-logo-512.png"
},
"default_title": "GNU Taler Wallet",
"default_popup": "static/popup.html"
}
}

View File

@ -1,11 +0,0 @@
/* eslint-disable no-undef */
/**
* Wrapper to catch any initialization error and show it in the logs
*/
try {
importScripts("dist/background.js");
self.skipWaiting();
console.log("SERVICE WORKER init: ok");
} catch (e) {
console.error("SERVICE WORKER failed:", e);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB