Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

bug: Browser plugin in iOS-popover presentation freezes app after dismiss #2711

Closed
1 of 4 tasks
chriswep opened this issue Apr 7, 2020 · 9 comments · Fixed by #2714
Closed
1 of 4 tasks

bug: Browser plugin in iOS-popover presentation freezes app after dismiss #2711

chriswep opened this issue Apr 7, 2020 · 9 comments · Fixed by #2714

Comments

@chriswep
Copy link

chriswep commented Apr 7, 2020

Capacitor Version: 2.0.0

Affected Platform(s)

  • Android
  • iOS
  • Electron
  • Web

Current Behavior

If opening an URL via the Browser plugin on iOS (13.4) with presentationStyle: 'popover', the app freezes after dismiss of the Browser modal.
The Safari remote inspector shows the opened webview and in can be inspected after dismissal. This indicates that something is not properly destroyed after dismiss.

presentationStyle: 'fullscreen' does not have this issue.

Expected Behavior

Remove the Webview / Browser-modal completely after dismiss of the popover

@chriswep
Copy link
Author

chriswep commented Apr 8, 2020

thanks @jcesarmobile that was quick!

as far as i see, you disabled the popover-style for everything but iPads? On iPhones i used this to achieve the iOS13 modal style. I manually copied your changed code without that restriction, and it works fine on iPhones.

@jcesarmobile
Copy link
Member

In which devices does the popover works? I thought it was iPad only, doesn’t show different Style on my iPhone X

@chriswep
Copy link
Author

chriswep commented Apr 8, 2020

on iPhone it opens an animated modal card (iOS13 style) instead of a fullscreen window

@jcesarmobile
Copy link
Member

Ah, my device is on iOS 12.

@jcesarmobile
Copy link
Member

Can you test this code with your change in a real iPhone?

async openBrowserPop() {
    await Browser.open({ url: 'https://www.google.com/', presentationStyle: 'popover' });
    setTimeout(() => {
      Browser.close();
    }, 5000);
  }

The Browser window should close itself after 5 seconds.

The point of the tmpWindow is because some modal presentations were frozing the javascript execution, so the close was never called.
If I let the popover on my iOS 12 iPhone it still gets frozen, and I don't have an iOS 13 iPhone (I could update, but then I can't go back on testing on iOS 12).
But maybe the iOS 13 popover doesn't freeze the javascript execution and we can allow the popover there.

@chriswep
Copy link
Author

chriswep commented Apr 9, 2020

i don't see any freezing on a real iPhone iOS13.
on iOS12 simulator it does freeze as soon as the browser opens.

@chriswep
Copy link
Author

@jcesarmobile do you want a new issue for this (enabling popover on iOS13-iPhone)?

@mchambaud
Copy link

on iOS14 it crashes you open + dismiss + open again

works fine when using fullscreen

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 11, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 11, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants