proyecto26 / react-native-inappbrowser

📱InAppBrowser for React Native (Android & iOS) 🤘
https://www.npmjs.com/package/react-native-inappbrowser-reborn
MIT License
1.29k stars 219 forks source link

window.close works in some situation but not in another #459

Open zoultrex opened 2 weeks ago

zoultrex commented 2 weeks ago

I have a react page loaded by inapp browser, its a test page, I have placed a simple button when onClick event is triggered it just calls window.close() and this works as expected when I load this page from my local machine using ngrok

When I publish this page live, which is a thank you page after a purchase from an ecommerce platform, the button no longer works

Could it be because first inappbrowser opens the ecommerce platform callback URL, then their page loads some data to process and when its finished redirects back to my page published on my own domain and then window.close longer works?

Is there such a security policy or anything else that is expected to prevent the window from being closed (like similar behavior to spam or whatever?) or could that be just a bug or wrong method I'm calling to close the window and the inapp browser?

I actually don't have to use window.close, but I need to have a button on my react page that makes the inapp browser close so the user goes back to the app, any other suggestion appreciated

gabe-o-fetchly commented 1 week ago

Can someone chime in on that? its super easy to reproduce, open a page with a button action window.close and it works Make a page with a button that redirects to another page that then has the button with window.close and it won't work Is this expected?

zoultrex commented 4 days ago

bump