detectWebpageLocale(for:completionHandler:)
Called to detect the locale of the webpage currently loaded in the tab.
Declaration
optional func detectWebpageLocale(for context: WKWebExtensionContext, completionHandler: @escaping (Locale?, (any Error)?) -> Void)optional func detectWebpageLocale(for context: WKWebExtensionContext) async throws -> Locale?Parameters
- context:
The context in which the web extension is running.
- completionHandler:
A block that must be called upon completion. The block takes two arguments: the detected locale (or
nilif the locale is unknown) and an error, which should be provided if any errors occurred.
Discussion
No action is performed if not implemented.