braintree / popup-bridge-android

PopupBridge allows WebViews to open popup windows in a browser and send data back to the WebView
MIT License
53 stars 28 forks source link

Navigation is blocked, auto return sucks #66

Closed pcicp closed 1 year ago

pcicp commented 1 year ago

Screenshot_1671797307

General information

Issue description

when i completed payment, paypal auto return sucks, can't close custom tabs and back to activity

inspect chrome, console warn: Navigation is blocked: xxx.popupbridge://popupbridgev1/yyy&PayerID=aaa&st=Completed&tx=bbb&cc=USD&amt=0.01&cm=0%3B5&payer_email=ccc&payer_id=ddd&payer_status=VERIFIED&first_name=eee&last_name=fff&txn_id=ggg&mc_currency=USD&mc_fee=0.01&mc_gross=0.01&protection_eligibility=ELIGIBLE&payment_fee=0.01&payment_gross=0.01&payment_status=Completed&payment_type=instant&handling_amount=0.00&shipping=0.00&item_name=hhh&quantity=1&txn_type=web_accept&payment_date=iii&receiver_id=jjj&notify_version=UNVERSIONED&custom=kkk&invoice=mmm&verify_sign=nnn

AndroidManifest.xml: `<activity android:name="yyyActivity" android:launchMode="singleTask" android:screenOrientation="portrait" android:exported="true">

`

sshropshire commented 1 year ago

Hi @pcicp thanks for using the Braintree SDK for Android. This may be an issue with the PayPal JS SDK. Does this occur every time? Also can you provide a video of the steps taken to reproduce the issue? We can forward this video to the correct team.

pcicp commented 1 year ago

finally, i found it's caused by chrome security. i refer to https://github.com/EddyVerbruggen/Custom-URL-scheme/issues/156.

our website used deprecated solution PayPal Payments Standard HTML variables.

set a middle page as return url, not popupbridge url directly. if user direct click paypal return, middle page load js to redirect popupbridge url. if user wait paypal auto return countdown finished, middle page prompt user to click popupbridge url to avoid navigation blocked.