Support for moving webview-based views into a secondary window or tab.
For webview-based views a new button becomes available in the toolbar of the view to move the view to a secondary window.
This is only supported for webview-based views and only one view can be moved into the secondary window.
The window extraction is not added to the electron app for now as there are issues with close handling of secondary windows on Electron.
There can be multiple secondary windows though.
Primary code changes:
- Add concept of extractable widgets. Only widgets implementing the interface can be extracted.
- Add `SecondaryWindowHandler` that encapsulates logic to move widgets to new windows.
- Add service `SecondaryWindowService` to handle creating and focussing external windows based on the platform.
- Only webviews can be extracted
- Configure opened secondary windows in electron
- Hide electron menu
- Always use the native window frame for secondary windows to get window controls
- Do not show secondary window icon if main window uses a custom title bar
- Contribute widget extraction button in a separate new extension `widget-extraction-ui`
- Extend application shell areas with a `secondaryWindow` area that contains all extracted widgets
- Extend frontend and webpack generators to generate the base html for secondary windows and copy it to the lib folder
- Bridge plugin communication securely via secure messaging between external webview and Theia:
Webviews only accept messages from its direct parent window. This is necessary to avoid Cross Site Scripting (XSS).
To make the messaging work in secondary windows, messages are sent to the external widget and then delegated to the webview's iframe.
Thereby, the secondary window only accepts messages from its opener which is the theia main window.
To achieve this, a webview knows the secondary window it is in (if any). It then sends messages to this window instead of directly to the webview iframe.
- Patch PhosphorJS during application webpack build
- Use string-replace-loader to remove the critical line from PhosphorJS during application bundleing
- Extend `webpack generator.ts` to add this to applications' `gen-webpack.config.js`
- Add extension `secondary-window` which contributes the UI integration (and possibly later more)
Contributed on behalf of ST Microelectronics and Ericsson and by ARM and EclipseSource.
Co-authored-by: Stefan Dirix <[email protected]>
Co-authored-by: robmor01 <[email protected]>
Signed-off-by: Lucas Koehler <[email protected]>