This PR contains a fix available in almost all modern browsers using noopener related to the issue reported about the merchant not receiving the onApprove callback after the PayPal checkout process.
Click outside anywhere on the page, the popup disappears.
Click on the Click to Continue message on the PayPal modal.
If you log in the communication between the child and parent is broken and the popup is not able to call the onInitor onApprove callbacks.
Explanation
The problem here is how the browser window.open API works. The short history is the open will set interface opener inside the opened URL with the window context where the open API was called. We're using the window.open('', name) to get the focus on the popup. That means will override the opener all the time we use this approach, base on the Browser API description here Window.opener.
To avoid this browser behavior we need to pass the noopener windowFeature` as a third param, this guarantees will not modify the original opener interface on the PayPal popup.
Description
This PR contains a fix available in almost all modern browsers using noopener related to the issue reported about the merchant not receiving the onApprove callback after the PayPal checkout process.
Why are we making these changes:
Please refer to these links: JIRA GitHub
Reproduction Steps
On the PayPal smart buttons follow these steps:
Click to Continue
message on the PayPal modal.onInit
oronApprove
callbacks.Explanation
The problem here is how the browser
window.open
API works. The short history is the open will set interfaceopener
inside the opened URL with the window context where theopen
API was called. We're using thewindow.open('', name)
to get the focus on the popup. That means will override the opener all the time we use this approach, base on the Browser API description here Window.opener. To avoid this browser behavior we need to pass thenoopener
windowFeature` as a third param, this guarantees will not modify the original opener interface on the PayPal popup.