Theia API Documentation v1.67.0
    Preparing search index...

    Function registerWebviewViewProvider

    • Registers a webview panel serializer.

      Extensions that support reviving should have an "onWebviewPanel:viewType" activation event and make sure that registerWebviewPanelSerializer is called during activation.

      Only a single serializer may be registered at a time for a given viewType.

      Parameters

      • viewId: string
      • provider: WebviewViewProvider
      • Optionaloptions: { webviewOptions?: { retainContextWhenHidden?: boolean } }
        • Optional ReadonlywebviewOptions?: { retainContextWhenHidden?: boolean }

          Content settings for the webview created for this view.

          • Optional ReadonlyretainContextWhenHidden?: boolean

            Controls if the webview element itself (iframe) is kept around even when the view is no longer visible.

            Normally the webview's html context is created when the view becomes visible and destroyed when it is hidden. Extensions that have complex state or UI can set the retainContextWhenHidden to make the editor keep the webview context around, even when the webview moves to a background tab. When a webview using retainContextWhenHidden becomes hidden, its scripts and other dynamic content are suspended. When the view becomes visible again, the context is automatically restored in the exact same state it was in originally. You cannot send messages to a hidden webview, even with retainContextWhenHidden enabled.

            retainContextWhenHidden has a high memory overhead and should only be used if your view's context cannot be quickly saved and restored.

      Returns Disposable