from spa to pwa
@ -86,5 +86,24 @@ justify-content: center;
|
|||||||
<!-- <hr />
|
<!-- <hr />
|
||||||
<iframe src="stories.html" name="wallet" width="800" height="100%"> -->
|
<iframe src="stories.html" name="wallet" width="800" height="100%"> -->
|
||||||
<script type="module" src="background.dev.js"></script>
|
<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>
|
</body>
|
||||||
</html>
|
</html>
|
31
packages/taler-wallet-webextension/src/pwa/manifest.json
Normal 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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 39 KiB |
6
packages/taler-wallet-webextension/src/pwa/sw.js
Normal 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 */);
|
||||||
|
});
|
@ -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"
|
|
||||||
}
|
|
||||||
}
|
|
@ -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);
|
|
||||||
}
|
|
Before Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 2.7 KiB |