Contents

setFrame(_:for:completionHandler:)

Called to set the frame of the window.

Declaration

optional func setFrame(_ frame: CGRect, for context: WKWebExtensionContext, completionHandler: @escaping ((any Error)?) -> Void)
optional func setFrame(_ frame: CGRect, for context: WKWebExtensionContext) async throws

Parameters

  • frame:

    The new frame of the window, in screen coordinates.

  • 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

On macOS, the implementation of both frame(for:) and screenFrame(for:) are prerequisites. On iOS, iPadOS, and visionOS, only frame(for:) is a prerequisite. Without the respective method(s), this method will not be called.

See Also

Related Documentation