Manifest ignored when payment handler installed from an iframe |
||
Issue description
The name and icon from the web app manifest apply only when the payment handler is installed from the top-level context. However, the manifest is ignored when payment handler installed from an iframe.
Toplevel HTML:
<!doctype html>
<meta charset="utf-8">
<title>Toplevel</title>
<link rel="manifest" href="web-app-manifest.json">
<iframe src="installer.html"></iframe>
Iframe HTML (installer.html):
<!doctype html>
<meta charset="utf-8">
<title>Iframe</title>
<link rel="manifest" href="web-app-manifest.json">
<p>Iframe</p>
<script>
navigator.serviceWorker.register('serviceworker.js').then(() => {
navigator.serviceWorker.ready.then(registration => {
registration.paymentManager.instruments.clear().then(() => {
registration.paymentManager.instruments.set('instrument-key', {
name: 'Instrument Name',
icons: [
{src: 'icon-256x256.png', sizes: '256x256', type: 'image/png'},
],
enabledMethods: ['basic-card'],
});
});
});
});
</script>
Web app manifest contents (web-app-manifest.json):
{
"name": "Test Basic Card Payment Handler",
"icons": [
{
"src": "/images/rgrg-256x256.png",
"sizes": "256x256",
"type": "image/png"
}
]
}
,
Feb 14 2018
Is the web_app_manifest.json the same in the main and iframe? If it is, we may be able to get it from the main frame by using GetOuterWebContents (https://cs.chromium.org/chromium/src/content/browser/web_contents/web_contents_impl.h?rcl=4a8beb3935a947b66f658bfe8071b6d394ac636d&l=176) at here (https://cs.chromium.org/chromium/src/content/browser/payments/payment_app_info_fetcher.cc?rcl=4a8beb3935a947b66f658bfe8071b6d394ac636d&l=86).
,
Feb 14 2018
It's the same, although it would be better to get the iframe's manifest, since that's the context that's installing the payment handler. Is that a possibility?
,
Feb 14 2018
Until now, no, only main frame from here (https://cs.chromium.org/chromium/src/content/public/browser/web_contents.h?rcl=a016e4d35b958ea13a944a5dd46b5c5d39353c50&l=745). Not sure it is by design or just hard to do that.
,
Feb 14 2018
CC'd mlamouri@ who is the manifest owner for help, Hey mlamouri@, do you have idea of why manifest is only available for main frame?
,
Feb 15 2018
If can get any of it I need really bad this is a on going thing about broke me
,
Feb 15 2018
I know nothing about Payment but the Manifest by definition is meant to apply to the main frame. I guess the Payment code might try to grab the main frame's manifest if they are same origin?
,
Feb 15 2018
We can do some payment-specific plumbing to fix this to help with the use case of a payment handler being installed from an iframe on a merchant website of a different origin. This would not apply to webapp manifests in general. Sounds good, mlamouri@?
,
Feb 16 2018
Keep up good work get all u can I will need copy's of all of it sent to my bank please William Harper citizens banks if batesville ark on this street please
,
Feb 16 2018
I just a records of all my payments and received payments for this identity theft cause I have never received payments online or made any on it either and recorded of all of it please sent to my bank asap
,
Feb 27 2018
But all information to bigdaddyharper2@gmail.com
,
Feb 27 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2d912bfdcd9e1bbeb24950cb741812b666d35597 commit 2d912bfdcd9e1bbeb24950cb741812b666d35597 Author: gogerald <gogerald@google.com> Date: Tue Feb 27 16:00:03 2018 [Payments] Get web app manifest from the main frame's document Bug: 812297 Change-Id: Iebd00dd49749c279088149b3b7fc6ba79aced58b Reviewed-on: https://chromium-review.googlesource.com/932748 Reviewed-by: Rouslan Solomakhin <rouslan@chromium.org> Commit-Queue: Ganggui Tang <gogerald@chromium.org> Cr-Commit-Position: refs/heads/master@{#539438} [modify] https://crrev.com/2d912bfdcd9e1bbeb24950cb741812b666d35597/content/browser/payments/payment_app_info_fetcher.cc
,
Feb 28 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2cbd63e9c3366aa9844504cd490e1e22017be5b5 commit 2cbd63e9c3366aa9844504cd490e1e22017be5b5 Author: gogerald <gogerald@google.com> Date: Wed Feb 28 01:56:08 2018 [Payments] Get top level web_contents through render frame host Bug: 812297 Change-Id: If80bd0068a77fa973f7f0966429b54f31931dbb7 Reviewed-on: https://chromium-review.googlesource.com/939872 Reviewed-by: Rouslan Solomakhin <rouslan@chromium.org> Commit-Queue: Ganggui Tang <gogerald@chromium.org> Cr-Commit-Position: refs/heads/master@{#539646} [modify] https://crrev.com/2cbd63e9c3366aa9844504cd490e1e22017be5b5/content/browser/payments/payment_app_info_fetcher.cc
,
Mar 1 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1b8e49ebb700c1399f788444b7ddf25e7e7bd2d7 commit 1b8e49ebb700c1399f788444b7ddf25e7e7bd2d7 Author: gogerald <gogerald@google.com> Date: Thu Mar 01 01:50:46 2018 [Payments] Use url.mojom.Url for stricter type check Bug: 812297 Change-Id: Ifb855b4e52ed3fde171569a017fa856cad5cc2dd Reviewed-on: https://chromium-review.googlesource.com/940324 Commit-Queue: Ganggui Tang <gogerald@chromium.org> Reviewed-by: Ken Buchanan <kenrb@chromium.org> Reviewed-by: Rouslan Solomakhin <rouslan@chromium.org> Cr-Commit-Position: refs/heads/master@{#539979} [modify] https://crrev.com/1b8e49ebb700c1399f788444b7ddf25e7e7bd2d7/content/browser/payments/payment_app_content_unittest_base.cc [modify] https://crrev.com/1b8e49ebb700c1399f788444b7ddf25e7e7bd2d7/content/browser/payments/payment_manager.cc [modify] https://crrev.com/1b8e49ebb700c1399f788444b7ddf25e7e7bd2d7/content/browser/payments/payment_manager.h [modify] https://crrev.com/1b8e49ebb700c1399f788444b7ddf25e7e7bd2d7/third_party/WebKit/Source/modules/payments/PaymentManager.cpp [modify] https://crrev.com/1b8e49ebb700c1399f788444b7ddf25e7e7bd2d7/third_party/WebKit/public/platform/modules/payments/payment_app.mojom
,
Aug 20
Issue 875743 has been merged into this issue. |
||
►
Sign in to add a comment |
||
Comment 1 Deleted