New issue
Advanced search Search tips

Issue 812297 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

Manifest ignored when payment handler installed from an iframe

Project Member Reported by rouslan@chromium.org, Feb 14 2018

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"
    }
  ]
}

 

Comment 1 Deleted

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?
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.
Cc: mlamouri@chromium.org
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?
If can get any of it I need really bad this is a on going thing about broke
me
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?
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@?
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
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
But all information to bigdaddyharper2@gmail.com
Project Member

Comment 12 by bugdroid1@chromium.org, 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

Project Member

Comment 13 by bugdroid1@chromium.org, 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

 Issue 875743  has been merged into this issue.

Sign in to add a comment