diff --git a/Sources/Latte+WKWebView.swift b/Sources/Latte+WKWebView.swift index f36e315..f65d150 100644 --- a/Sources/Latte+WKWebView.swift +++ b/Sources/Latte+WKWebView.swift @@ -86,7 +86,11 @@ class LatteWKWebView: WKWebView, WKNavigationDelegate { func dispatchSignal(signal: LatteBuiltInSignals) { self.evaluateJavaScript(""" - window.dispatchSignal("\(signal.rawValue)"); + document.dispatchEvent( + new CustomEvent("latte:signal", { + detail: { type: "\(signal.rawValue)" }, + }) + ); """) }