Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Multi window support for web views #11048

Merged
merged 1 commit into from
Sep 5, 2022

Commits on Sep 2, 2022

  1. Multi window support for web views

    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]>
    3 people committed Sep 2, 2022
    Configuration menu
    Copy the full SHA
    97f6360 View commit details
    Browse the repository at this point in the history