commit 7b6706bee3cbecc84b330672ecdb5764d7d68756 Author: Florian Dold Date: Wed Nov 25 20:41:31 2015 +0100 Add skeleton for WebExtensions wallet diff --git a/README b/README new file mode 100644 index 000000000..4bfb203d8 --- /dev/null +++ b/README @@ -0,0 +1,8 @@ +Cross-browser Taler wallet written for the WebExtensions API. +See https://developer.mozilla.org/en-US/Add-ons/WebExtensions + +Installation +============ + +Run ./pack to create the taler-wallet.xpi file. + diff --git a/extension/background/wallet.js b/extension/background/wallet.js new file mode 100644 index 000000000..a7a9c6cb6 --- /dev/null +++ b/extension/background/wallet.js @@ -0,0 +1,2 @@ +// Nothing here yet. +// Eventually, the backend for the wallet will be implemented here. diff --git a/extension/content_scripts/notify.js b/extension/content_scripts/notify.js new file mode 100644 index 000000000..3a0f9001d --- /dev/null +++ b/extension/content_scripts/notify.js @@ -0,0 +1,18 @@ +// Script that is injected into pages in order to allow merchants pages to +// query the availability of Taler. + + +// Listen to messages from the backend. +chrome.runtime.onMessage.addListener( + function(request, sender, sendResponse) { + // do nothing, yet +}); + + +document.addEventListener('taler-checkout-probe', function(e) { + let evt = new Event('taler-wallet-present'); + document.dispatchEvent(evt); +}); + +console.log("Taler wallet: content page loaded"); + diff --git a/extension/icons/taler-logo-24.png b/extension/icons/taler-logo-24.png new file mode 100644 index 000000000..00a908e79 Binary files /dev/null and b/extension/icons/taler-logo-24.png differ diff --git a/extension/manifest.json b/extension/manifest.json new file mode 100644 index 000000000..b0ad9720e --- /dev/null +++ b/extension/manifest.json @@ -0,0 +1,41 @@ +{ + "description": "Privacy preserving and transparent payments", + "manifest_version": 2, + "name": "Taler Wallet", + "version": "1.0", + + "applications": { + "gecko": { + "id": "devs@taler.net" + } + }, + + "permissions": [ + "http://*/*", + "https://*/*" + ], + + "browser_action": { + "default_icon": "icons/taler-logo-24.png", + "default_title": "Taler", + "default_popup": "popup/wallet.html" + }, + + "web_accessible_resources": [ + "popup/reserves.html", + "popup/wallet.html" + ], + + "content_scripts": [ + { + "matches": ["*://*/*"], + "js": ["content_scripts/notify.js"], + "run_at": "document_start" + } + ], + + "background": { + "scripts": ["background/wallet.js"] + } + +} diff --git a/extension/popup/reserves.html b/extension/popup/reserves.html new file mode 100644 index 000000000..63db032e5 --- /dev/null +++ b/extension/popup/reserves.html @@ -0,0 +1,7 @@ + + +Back + +

+ +Your reserves are listed here. diff --git a/extension/popup/transactions.html b/extension/popup/transactions.html new file mode 100644 index 000000000..427100853 --- /dev/null +++ b/extension/popup/transactions.html @@ -0,0 +1,7 @@ + + +Back + +

+ +Your past transactions are listed here. diff --git a/extension/popup/wallet.html b/extension/popup/wallet.html new file mode 100644 index 000000000..f27387b1d --- /dev/null +++ b/extension/popup/wallet.html @@ -0,0 +1,21 @@ + + + + + + + + + This is the Taler wallet. + +

+ + Reserves + Transaction History + +

+ + Your balance will be displayed here. + + + diff --git a/pack b/pack new file mode 100755 index 000000000..a8779b37c --- /dev/null +++ b/pack @@ -0,0 +1,12 @@ +#!/bin/bash + +# Pack up the extension as an xpi file. + +set +x + +# directory where our script resides +mydir="$(dirname "$(readlink -f "$0")")" + +cd "$mydir/extension" + +exec zip -r ../taler-wallet.xpi * diff --git a/serve-testpages b/serve-testpages new file mode 100755 index 000000000..b0451cd1f --- /dev/null +++ b/serve-testpages @@ -0,0 +1,11 @@ +#!/bin/bash + +# Start a web server on port 8000 to serve test pages for the wallet extension. + +set +x + +# directory where our script resides +mydir="$(dirname "$(readlink -f "$0")")" + +cd "$mydir/testpages/" +exec python3 -m http.server 8000 diff --git a/testpages/testpage_merchant.html b/testpages/testpage_merchant.html new file mode 100644 index 000000000..1598cc046 --- /dev/null +++ b/testpages/testpage_merchant.html @@ -0,0 +1,16 @@ + + + +Waiting for Taler wallet ...