HeyPuter / terminal

⌨️ Web-based terminal in pure JavaScript
https://puter.com/app/terminal
GNU Affero General Public License v3.0
113 stars 15 forks source link

Terminal not loading in some browsers #2

Open jelveh opened 7 months ago

jelveh commented 7 months ago

As reported by this user.

Chromium Version 123.0.6298.0 (Developer Build) (64-bit) from tip-of-tree developer builds today. On Linux.

Screenshot at https://gist.github.com/guest271314/94453a1f538df44be1623f75b0ed4b71

It would help if you didn't try to prevent inspecting the page.

There are several warnings and a couple errors thrown

v2/:4 WebSocket connection to 'wss://api.puter.com/socket.io/?auth_token=undefined&EIO=4&transport=websocket&sid=9uLAXMZ0SsMnkBVsAHNF' failed: WebSocket is closed before the connection is established.

bundle.js:10622 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'setAuthToken') at window.main_shell (bundle.js:10622:28)

KernelDeimos commented 7 months ago

This means globalThis.puter is undefined, which is unexpected. Is it possible the Puter SDK doesn't work properly in this version of Chromium?

jelveh commented 7 months ago

I'm looking into it. Need to open-source Puter.js ASAP!

jelveh commented 7 months ago

I still haven't been able to replicate this

guest271314 commented 7 months ago

I still haven't been able to replicate this

I'm on Linux. Chromium Version 123.0.6298.0 (Developer Build) (64-bit) off tip-of-tree builds from a couple days ago.

jelveh commented 7 months ago

Do you have any privacy extensions? The terminal uses canvas and it's known to be blocked by some extensions because some websites seem to abuse canvas (idk how they do it though)

guest271314 commented 7 months ago

No "privacy" extensions.

KernelDeimos commented 7 months ago

Does this occur on the stable build of Chromium too?

(idk how they do it though)

AFAIK, WebGPL rendering and then analyzing GPU-specific behaviour. It's wild.

guest271314 commented 7 months ago

The terminal uses canvas

AFAIK, WebGPL rendering and then analyzing GPU-specific behaviour.

Why are you using canvas and WebGPL for this?

QuickJS and SpiderMonkey has been compiled to WASM for use as a JavaScript runtime in the browser - without using any images. See https://bellard.org/jslinux/ and https://github.com/mozilla-spidermonkey/sm-wasi-demo. node has even been compiled to WASM using v86 https://github.com/cemalgnlts/now.

Is the idea to send data over the network for this and render images that just look like a terminal and other applications?

Just use a <textarea> or something.

KernelDeimos commented 7 months ago

Why are you using canvas and WebGPL for this?

We don't do this; xtermjs does this. (edit: I don't believe xtermjs uses WebGL; I was mentioning that in different context; it does use canvas though)

Is the idea to send data over the network for this and render images that just look like a terminal and other applications?

phoenix aims to be a complete POSIX-compliant shell. We're still pretty far away from that goal but there's a clear roadmap. We're absolutely open to including javascript runtimes in Puter - one thing we need to do first is enable phoenix to run external commands (it will process script files but it doesn't retrieve commands from PATH yet)

Just use a