New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 779253 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 1
Type: Bug-Regression



Sign in to add a comment

RequestPayment.canMakePayment() returns an empty promise when called from a Chrome extension page

Reported by jasonsav...@gmail.com, Oct 27 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36

Steps to reproduce the problem:
1. Create a Chrome extension with an option page (or any page)
2. In the options page initialize a PaymentRequest object then call it's method canMakePayment (refer to attachment)
3. 

What is the expected behavior?
canMakePayment() should return a promise with an object

What went wrong?
canMakePayment returns a promise with no object or null

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 62.0.3202.75  Channel: stable
OS Version: 10.0
Flash Version: 

The canMakePayment does successfully run in a normal Chrome webpage, just not inside a Chrome extension page. My hint is might be checking the protocol for https:// but instead it's finding chrome-extension://
 
payment_request.js
634 bytes View Download
Labels: Needs-Triage-M62
Cc: divya.pa...@techmahindra.com
Components: Platform>Extensions
Labels: Triaged-ET Needs-Feedback
@ jasonsavard: Please attach a sample test file to test URL, that would help in further triaging the issue from TE end.

Thanks!
Attached is a sample extension with an options page and a popup button that both open the same js file that calls the canMakePayment() and returns an alert of fail or success.
sample_extension.zip
1.4 KB Download
Project Member

Comment 4 by sheriffbot@chromium.org, Oct 30 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "divya.padigela@techmahindra.com" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: krajshree@chromium.org
Labels: Needs-Feedback
Unable to reproduce the issue on Win-10 using chrome reported version #62.0.3202.75 and latest canary #64.0.3254.0.

Attached a screen cast for reference.

Following are the steps followed to reproduce the issue.
------------
1. Added the sample_extension to chrome://extensions page.
2. Clicked on options link of that extension and observed that a pop up opened in another tab with a "fail' alert.

jasonsavard@ - Could you please check the screen cast and please let us know if anything missed from our side and also please check the issue on latest canary #64.0.3254.0 by creating a new profile without any apps and extensions and please let us know if the issue still persists or not.

Thanks...!!
779253.webm
1.4 MB View Download
lol, so your screen cast proves that it fails. But, I understand your confusion though, the code displays "fail" if the test fails and not what the canMakePayment returns. If it doesn't return an object then it displays "fail" as you see in your screen cast.
Project Member

Comment 7 by sheriffbot@chromium.org, Oct 31 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "krajshree@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: susanjuniab@chromium.org
Labels: -Type-Bug -Pri-2 hasbisect-per-revision ReleaseBlock-Stable M-64 OS-Linux OS-Mac Pri-1 Type-Bug-Regression
Owner: jinho.b...@samsung.com
Status: Assigned (was: Unconfirmed)
Able to reproduce this issue on Windows 7, Mac OS 10.12.6 and Ubuntu 14.04 on latest stable 62.0.3202.75 and Canary 64.0.3255.0	with the steps mentioned in comment #5.

Bisect Information:
=====================
Good build: 62.0.3194.0 (Revision-496533)
Bad Build : 62.0.3196.0 (Revision-497279)

Note: From M50 builds till build 62.0.3194.0, can observe that on loading the sample_extensions and on clicking the options link in chrome://extensions, a blank page is seen.
From 62.0.3196.0 version, on following the above steps, a fail alert is shown.
Hence considering 62.0.3194.0 as good build and 62.0.3196.0 as bad build.(62.0.3195.0 is not available for testing).

Change Log URL: 
===============
https://chromium.googlesource.com/chromium/src/+log/b2fbea12e27ac2fca470df1c2d95c49f7e54cfeb..4ce18bf7c445c25aec490bda84ded2733933844f

From the above change log the possible CL suspect is:
Reviewed-on: https://chromium-review.googlesource.com/601649

jinho.bang@ Could you please check whether this issue is caused with respect to your change, if not please help us in assigning it to the right owner.

Adding ReleaseBlock-Stable as this is a recent regression. Please feel free to remove it if this is not the case.

Thanks...!!
Please note that a blank options page in the sample extension does not mean it worked, it should actually display a "success" alert if Chrome has saved credit cards to Autofill & Google Payments. More info https://support.google.com/chrome/answer/142893

Just to re-iterate that if you take the code inside payment_request.js and run it in on a website, it works, but run that same code in an extension's option page and it does not work.
Okay, I'll check it.
Cc: rouslan@chromium.org
I've just checked this issue. This is not regression.

Current implementation doesn't support PaymentRequest API in chrome:// scheme. So, this is not "Release block" and is a new feature request, I think, but I'm not sure because I'm not googler. Rouslan will be able to clarify this.

Rouslan, do you have a plan to support PaymentRequest API in chrome:// scheme as well?
Just to be precise, Chrome extension schemes are chrome-extension://
I think chrome:// is for internal Chrome pages like settings etc.
Cc: ma...@chromium.org
Components: Blink>Payments
Labels: -ReleaseBlock-Stable OS-Chrome
We should not allow PaymentRequest API on extensions. The best developer experience would be window.PaymentRequest===undefined. We do this on WebView, for example.

Does anyone on Extensions Team know how to turn off a JavaScript API in extensions?

(This is not a release blocker.)

Sign in to add a comment