package eu.friedcutlet.yokan.services.extensions.js /** * Extension sources need a synchronous QuickJS bridge; zipline has no wasm * artifact, so JavaScript-based extensions are unavailable in the browser. * Every call fails with a clear [UnsupportedOperationException] instead of * returning empty results. */ // ponytail: evaluating in the page's own JS engine would not help either: the host HTTP bridge is // synchronous and the browser cannot block on fetch. Upgrade path: promise-returning host calls // awaited by an async (suspend) engine API. actual fun createJavaScriptEngine(bridge: JavaScriptMessageBridge): JavaScriptEngine = UnsupportedJavaScriptEngine private object UnsupportedJavaScriptEngine : JavaScriptEngine { override fun evaluate(script: String, isCancelled: () -> Boolean): String = throw UnsupportedOperationException("JavaScript extensions are not supported in the browser.") override fun close() = Unit }