Contents

setWindowState(_:for:completionHandler:)

Called to set the state of the window.

Declaration

optional func setWindowState(_ state: WKWebExtension.WindowState, for context: WKWebExtensionContext, completionHandler: @escaping ((any Error)?) -> Void)
optional func setWindowState(_ state: WKWebExtension.WindowState, for context: WKWebExtensionContext) async throws

Parameters

  • state:

    The new state of the window.

  • context:

    The context in which the web extension is running.

  • completionHandler:

    A block that must be called upon completion. It takes a single error argument, which should be provided if any errors occurred.

Discussion

The implementation of windowState(for:) is a prerequisite.

Without it, this method will not be called.

See Also

Related Documentation