- From: Marcos Cáceres <notifications@github.com>
- Date: Tue, 24 Jan 2017 20:32:57 -0800
- To: w3c/webpayments-payment-apps-api <webpayments-payment-apps-api@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/webpayments-payment-apps-api/issues/95/275016740@github.com>
It's what I said there: "I was not proposing 1 [service worker] per origin. What I was trying to say is, you can register as many service workers as you like, but the "feature" is controlled per origin (like any other powerful feature)."
Again, in pictures, I want this on "bank.com":

And I want this on "merchant.com" when I go to pay:

And this is what is "totally bogus" (apologies if I misread and you were not proposing the below):
```JS
const reg1 = await serviceWorker.register("app1.sw");
const reg2 = await serviceWorker.register("app2.sw");
reg1.paymentManager.setName("SUPER COOL CARD MANAGER");
reg1.paymentManager.setIcon("super-app1.png");
reg2.paymentManager.setName("I'M A TOTALLY DIFFERENT CARD MANAGER");
reg2.paymentManager.setIcon("TOTALY_DIFFERENT_APP.jpeg");
await Promise.all([reg1.paymentManager.register(), reg2.paymentManager.register()];
```
Which is why the manifest (or HTML things) should set the name and the icon of the web application.
Also, calling reg1's `.register()` should grant permission to reg2, because ".register()" is a permission grant. I think you agree with that, no?
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webpayments-payment-apps-api/issues/95#issuecomment-275016740
Received on Wednesday, 25 January 2017 04:33:33 UTC