From c5a3067557addd491d46123f40d6942897f0457b Mon Sep 17 00:00:00 2001 From: "Maarten A. Breddels" Date: Tue, 18 Jul 2023 15:50:09 +0200 Subject: [PATCH] refactor: we need no special support for pyodide --- solara/server/static/main-vuetify.js | 40 +--------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/solara/server/static/main-vuetify.js b/solara/server/static/main-vuetify.js index 40ee1607b..d9fab8d30 100644 --- a/solara/server/static/main-vuetify.js +++ b/solara/server/static/main-vuetify.js @@ -79,38 +79,6 @@ function injectDebugMessageInterceptor(kernel) { } -class WebSocketRedirectWebWorker { - // redirects to webworker - constructor(url) { - console.log('connect url intercepted', url) - function make_default(name) { - return () => { - console.log("default ", name) - } - } - this.onopen = make_default('onopen') - this.onclose = make_default('onclose') - this.onmessage = make_default('onmessage') - setTimeout(() => this.start(), 10) - } - send(msg) { - // console.log('WebSocketRedirectWebWorker: send msg', msg) - window.parent.postMessage({ 'type': 'send', 'value': msg }) - } - start() { - self.addEventListener('message', async (event) => { - let msg = event.data - // console.log('WebSocketRedirectWebWorker on msg', msg) - if (msg.type == 'send') { - this.onmessage({ data: msg.value }) - } - }); - this.onopen() - // solaraWorker.postMessage({ 'type': 'open' }) - } -} - - function getCookiesMap(cookiesString) { return cookiesString.split(";") .map(function (cookieString) { @@ -153,13 +121,7 @@ async function solaraInit(mountId, appName) { kernel.dispose() window.navigator.sendBeacon(close_url); }); - console.log("solara.browser_platform", solara.browser_platform); - if (solara.browser_platform) { - options = { WebSocket: WebSocketRedirectWebWorker } - } else { - options = {} - } - let kernel = await solara.connectKernel(solara.rootPath + '/jupyter', uuid, options) + let kernel = await solara.connectKernel(solara.rootPath + '/jupyter', uuid) if (!kernel) { return; }