New issue
Advanced search Search tips

Issue 843920 link

Starred by 2 users

Issue metadata

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



Sign in to add a comment

WindowClient.focus() return a DOMException: Not allowed to focus a window in a payment handler context.

Reported by maxime.b...@gmail.com, May 17 2018

Issue description

Chrome Version       : 68.0.3432.0
OS Version: 10.0
URLs (if applicable) :https://test-payment-handler.appspot.com/

To test you will have to click on "Install Bobpay Web Payment App" at the end of the page. (You will probably need to uninstall and reinstall to have the payment handler working).
After that, click on The Lauch Payment Request in the center of the page.
(Once again the payment will probably display an error the first time, juste relauch a payment request)

The code failing is in the sw-bobpay.js service worker file (l 37).

Other browsers tested:
 Add OK or FAIL after other browsers where you have tested this issue:
    Safari: Not implemented
   Firefox: Not implemented
   IE/Edge: Not implemented

What steps will reproduce the problem?
1. Register a service worker that implement the 'paymentrequest' eventListener.
2. In the self.addEventListener's callback use event.openWindow to load a page in the chrome frame.
3. In the openWindow's callback if the WindowClient.focused is false, try to WindowCLient.focus().

What is the expected result?
The expected result is the WindowClient.focused property to turn true.


What happens instead of that?
DOMException: Not allowed to focus a window.


Please provide any additional information below. Attach a screenshot if
possible.
This issue make impossible to use the Web Authentication API inside of a payment handler because nagivator.credential.create will fail and prompt :
NotAllowedError:The operation is not allowed at this time because the page does not have focus.

UserAgentString: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3432.0 Safari/537.36
 
IssueChrome.PNG
67.0 KB View Download
To test, the "Service Worker payment apps" flag should be turned on.

Comment 2 by ma...@chromium.org, May 17 2018

Components: UI>Browser>Payments
Owner: gogerald@chromium.org
Status: Assigned (was: Unconfirmed)
Cc: rouslan@chromium.org
Sounds like window.focused should be true in the payment handler that's on top of the currently focused merchant checkout window. It does not seem right that a payment handler window should be able to focus itself when user is on a different tab. Filed https://github.com/w3c/payment-handler/issues/307 in spec.

Sign in to add a comment