ph/opossum

Description
# Opossum Web Browser

Basic portable Web browser; only needs a Go compiler to compile. Optimized for use on 9front and 9legacy, supports plan9port and 9pi as well.

The UI is built with https://github.com/mjl-/duit

<img src="https://psilva.sdf.org/browsing.png" width="550">

Still experimental and a lot of features are missing.

Supported features:

- rudimentary HTML5 and CSS support, large parts like float/flex layout are just stub implementations
- Server-side rendered websites
- Images (pre-loaded all at once though)
- TLS
- experimental JS/DOM can be activated (very basic jQuery examples work)
- file downloads

# Install

## Plan 9

    # Setup TLS
    hget https://curl.haxx.se/ca/cacert.pem > /sys/lib/tls/ca.pem
    # Create mountpoints (needed on 9legacy)
    mkdir /mnt/opossum
    mkdir /mnt/goja

### Binary

Binaries for amd64 and 386 can be downloaded from https://psilva.sdf.org/opossum.html

### Compile from Source

Set `$GOPROXY` to `https://proxy.golang.org` and then:

    go install ./cmd/opossum

Command line options:

    -h                   help
    -v                   verbose
    -vv                  print debug messages
    -jsinsecure          activate js
    -cpuprofile filename create cpuprofile

(-v and -vv produce a lot of output,
consider turning on scroll since processing
waits for that...)

`$font` is used to select the font. Very large fonts will set dpi to 200.

## macOS

Requirements:

- Go
- Plan9Port

```
go install ./cmd/opossum
```

# JS support

It's more like a demo and it's not really clear right now how much sandboxing
is really needed. A rudimentary AJAX implementation is there though.

Use on your own Risk!

Mostly based on goja (ECMAScript 5.1) and https://github.com/fgnass/domino
(fork of DOM implementation from Mozilla in JS). Some sort of DOM diffing
is needed, also AJAX functions, `getComputedStyle` etc. are either missing or stubs.
Very simple jQuery based code works though, e.g. jQuery UI Tab view
https://jqueryui.com/resources/demos/tabs/default.html or the toggle buttons on
https://golang.org/dl There is also highly experimental ES6 support with Babel.
(Needs also https://github.com/psilva261/6to5)

Install the js engine:

```
cd ..
git/clone https://github.com/psilva261/gojafs
cd gojafs
go install ./cmd/gojafs
```

On 9legacy also the folders `/mnt/opossum` and `/mnt/goja` need to exist.

Then it can be tested with:

```
opossum -jsinsecure https://jqueryui.com/resources/demos/tabs/default.html
```

# TODO

- load images on the fly
- implement more parts of HTML5 and CSS
- create a widget for div/span
- clean up code, support webfs, snarf
Last 5 commits (shortlog)
Date Author Short message Commit hash
2022-01-22 Philip Add stop button 860953fd9253e756a7427e31af262bf5c942fe14
2022-01-22 Philip Add short tests 3662834cbb526bcf9617b3221892d38a4d58deb7
2022-01-16 Philip Parse out @imports d61b126cf6eb12fa51c0ccb4d12114d524c7a9f8
2022-01-15 Philip parse at-rules in css d09f37f9a1ae9736abe320071764ffdfa3a61957
2022-01-10 Philip no more superfluous png encoding in between 294b8735087508d83c93f56e7991d64a97c3edea
Files (browse)
.gitattributes
.gitignore
LICENSE
README.md
browser/
cmd/
go.mod
go.sum
img/
js/
logger/
nodes/
normalize.css
opossum.go
opossum.jpg
opossum_plan9.go
opossum_unix.go
package.rc
style/