Class AutomationSession

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public final class AutomationSession extends GObject

Automation Session.

WebKitAutomationSession represents an automation session of a WebKitWebContext. When a new session is requested, a WebKitAutomationSession is created and the signal WebKitWebContext::automation-started is emitted with the WebKitAutomationSession as argument. Then, the automation client can request the session to create a new WebKitWebView to interact with it. When this happens the signal WebKitAutomationSession::create-web-view is emitted.

Since:
2.18
  • Constructor Details

    • AutomationSession

      public AutomationSession(MemorySegment address)
      Create a AutomationSession instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • AutomationSession

      public AutomationSession()
      Create a new AutomationSession.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the AutomationSession class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected AutomationSession asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class GObject
      Returns:
      the instance as if it were its parent type
    • getApplicationInfo

      public ApplicationInfo getApplicationInfo()

      Get the the previously set WebKitAutomationSession.

      Get the WebKitAutomationSession previously set with webkit_automation_session_set_application_info().

      Returns:
      the WebKitAutomationSession of session, or null if no one has been set.
      Since:
      2.18
    • getId

      public String getId()
      Get the unique identifier of a WebKitAutomationSession
      Returns:
      the unique identifier of this AutomationSession
      Since:
      2.18
    • setApplicationInfo

      public void setApplicationInfo(ApplicationInfo info)

      Set the application information to session.

      This information will be used by the driver service to match the requested capabilities with the actual application information. If this information is not provided to the session when a new automation session is requested, the creation might fail if the client requested a specific browser name or version. This will not have any effect when called after the automation session has been fully created, so this must be called in the callback of WebKitWebContext::automation-started signal.

      Parameters:
      info - a WebKitApplicationInfo
      Since:
      2.18
    • onCreateWebView

      This signal is emitted when the automation client requests a new browsing context to interact with it. The callback handler should return a WebKitWebView created with WebKitWebView:is-controlled-by-automation construct property enabled and WebKitWebView:automation-presentation-type construct property set if needed.

      If the signal is emitted with "tab" detail, the returned WebKitWebView should be a new web view added to a new tab of the current browsing context window. If the signal is emitted with "window" detail, the returned WebKitWebView should be a new web view added to a new window. When creating a new web view and there's an active browsing context, the new window or tab shouldn't be focused.

      Parameters:
      detail - the signal detail
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      Since:
      2.18
      See Also:
    • emitCreateWebView

      public WebView emitCreateWebView(@Nullable String detail)
    • onWillClose

      This signal is emitted when the given automation session is about to finish. It allows clients to perform any cleanup tasks before the session is destroyed.
      Parameters:
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      Since:
      2.46
      See Also:
    • emitWillClose

      public void emitWillClose()
      Emits the "will-close" signal. See onWillClose(AutomationSession.WillCloseCallback).
    • builder

      public static AutomationSession.Builder<? extends AutomationSession.Builder> builder()
      A AutomationSession.Builder object constructs a AutomationSession with the specified properties. Use the various set...() methods to set properties, and finish construction with AutomationSession.Builder.build().
      Returns:
      the builder object