egriff38 / popcorn

An integrated terminal for your web browser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Popcorn

An pop-up terminal for your browser.

screenshot

Check out a demo of the extension running from the arc browser here: https://www.capster.io/video/zRgddaTPilyn

Installation

Warning: Popcorn does not work on Windows yet (see this issue).

# clone the repository
git clone https://github.com/pomdtr/popcorn && cd popcorn

# install the cli
go install

# build the extension
cd extension
npm i
npm run build

Then go to the chrome://extensions page, activate the Developer mode and click on the Load unpacked button. You will need to select the extension/dist folder using the file picker.

Extension Page

Once you have installed the extension, copy the extension id, and run the following command:

popcorn init --browser chrome --extension-id <extension-id>

How does it work?

Popcorn is composed of two parts:

  • A CLI that will create a configuration file and a binary that will be used by the extension.
  • A Chrome extension that will communicate with the binary and display the terminal.

When the chrome extension is loaded, it will use the native messaging API to communicate with the host binary. An instance of an HTTP server will be started on the 9999 port.

When the popup is opened, the embedded terminal (xterm.js) will connect to the HTTP server and will be able to send and receive data through a websocket.

When you use the popcorn cli, the message is sent to the http server, and then piped to the chrome extension.

popcorn architecture

About

An integrated terminal for your web browser

License:MIT License


Languages

Language:Go 71.5%Language:TypeScript 26.5%Language:HTML 1.9%Language:Shell 0.1%