feat: iOS multi window / multi tasking support
Feature Request
Description
(I'm new here (and to Capacitor), hopefully I have this submission correct and I'm in the right place)
I'm building an app where it would be brilliant to be able to use the iOS multi window and multi tasking features on iPad. For example how in safari a long press on a link and dragging to the side of the screen opens a second safari screen with the new tab, or with Notes how dragging a note from the list to the side of the screen opens it in multi split screen mode. You can also open these windows next to other apps.
The aim wold be to support multi windows both within the app itself (split screen) but also paired side by side with other apps.
Obviously this is possible with a custom implementation (see example I found in the links below) but it would be brilliant if it was implemented in a generic way within capacitor or a capacitor plugin.
Platform(s)
iOS (Android?)
Preferred Solution
With Capacitors aim of replicating native web apis as closely as possible for PWA it seems to be there are a number of apis that this could build on. There would need to be a way to mark an object as draggable to create a new window, this could be with the html Drag and Drop api (https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API). You can also in iOS safari long press and click 'open in new window' this could be replicated with a window.open call from a custom menu. (I believe this currently opens the native browser and so the api would need to be an option, maybe when there is a windowFeatures object: https://developer.mozilla.org/en-US/docs/Web/API/Window/open)
Communication between windows would work best with both the window.postMessage (https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage) and BroadcastChannel (https://developer.mozilla.org/en-US/docs/Web/API/Broadcast_Channel_API) apis.
I understand this is a big change, it is taking Capacitor from having a single wkWebview to having multiple that can communicate with each other. However I think it would be a rally good feature to support and potentially opens up a few other interesting possibilities such as "native" modal "popup" windows which are another wkWebview that you can communicate with using the same api.
Alternatives
A per-app custom solution similar to that in the example linked below.
Additional Context
https://github.com/ionic-team/capacitor/issues/1940
https://stackoverflow.com/questions/61634043/enable-splitview-and-multitask-ipad-hybrid-app-drop-interaction
http://blogs.specialapps.in/SplitView_MultiTasking
https://www.youtube.com/watch?v=0yy8TOtvIu4
@samwillis any news about this feature ?
Cf https://developer.apple.com/documentation/uikit/uiscenedelegate/supporting_multiple_windows_on_ipad