Skip to content

mplsllc/macsurf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

645 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MacSurf

The modern web, on a 25-year-old Mac.

MacSurf is a web browser for Classic Mac OS 9 PowerPC.
Real CSS3. Real ES5 JavaScript. Real PNGs with alpha. Running on a beige G3.

status platform arch compiler css js license


Why MacSurf exists

The web outgrew Classic Mac OS twenty years ago. Modern HTTPS killed it for good around 2016. Today, an out-of-the-box G3 or G4 running OS 9 can barely reach a single live website.

MacSurf brings the real web back. Not a screenshot proxy. Not a remote terminal session. A native browser, built with the tools that were on the platform — CodeWarrior, the Carbon API, QuickDraw, Open Transport — running real CSS3 layouts and real JavaScript inside the 64-megabyte memory floor of a 1999 iMac.

It is, as far as we can find, the first serious NetSurf port to Classic Mac OS, and the first browser shipped on Mac OS 9 with native CSS Grid, CSS custom properties, and ES5 JavaScript.


The progression

Each shot below is a real milestone, captured on a Power Macintosh G3 running Mac OS 9. The fix-number annotations match this repo's commit history.

JavaScript Hello World on Mac OS 9
v0.2 — JavaScript on Mac OS 9
First real-world JS-bearing page. Duktape 2.7.0 ES5 evaluating live: Math.sqrt, JSON, ES5 array methods.
CSS transform rotate, scale, translate
fixes73 — CSS transforms
Native transform: rotate() / scale() / translate(). Integer Q15 sin/cos table, no FPU dependency — arbitrary angles on QuickDraw.
CSS radial gradients
fixes74d — radial gradients
2-stop radial gradients via concentric PaintOval stack. 16 levels smeared on decode. Shape + position keywords parsed.
CSS animations: wiggle, swing, slow spin
fixes77 — CSS animations
Linear ping-pong animation player on top of fixes73 rotation. Wiggle, swing, and full 0°→359° spin.
PNG image with transparency on Mac OS 9
fixes79b — PNG transparency
QuickTime Graphics Importer feeding the NetSurf image content handler. PNG + GIF + BMP, all with real transparency.
CSS word-break and overflow-wrap
fixes136 — word-break / overflow-wrap
word-break: break-all, keep-all, white-space: nowrap, legacy word-wrap: break-word. URL-style aggressive wrapping.
CSS z-index stacking contexts
fixes147 — stacking contexts
CSS 2.1 painting order. Opacity, transforms, and explicit z-index all create new stacking contexts — properly painted on real hardware.
CSS Grid column placement
fixes151 — CSS Grid column placement
grid-column: span N, 1 / -1 full-row hero, positional start / end, span + auto-wrap. Real Grid layout on OS 9.


What's in the box

ComponentLanguagePurpose
browser/ C (C89, CW8) NetSurf fork with a macos9 frontend. Carbon UI, QuickDraw plotters, Open Transport networking, Duktape JS engine.
proxy/ Go (stdlib only) TLS-stripping HTTP proxy. Mac sends plain HTTP, proxy fetches via HTTPS, returns plain HTTP. Deploy on a VPS or run locally.
macSSL
sibling repo
C (CW8) Native TLS 1.2 library for OS 9 — modern HTTPS straight from the Mac, no proxy required. Built on BearSSL with ten embedded root CAs.

What works today

Rendering pipeline

  • Full NetSurf fetch → parse → cascade → layout → plot
  • Native libcss with var() resolution
  • QuickDraw plotters with offscreen GWorld back-buffer

CSS — ~150 properties consumed in layout

  • Custom properties & var()
  • Flex (justify-content, align-content, order)
  • Grid V1 + grid-template-columns/rows, gap
  • border-radius, box-shadow, opacity
  • Linear & radial gradients
  • text-shadow, text-overflow: ellipsis
  • transform (rotate / translate / scale)
  • z-index stacking contexts (CSS 2.1 painting order)
  • CSS counters, viewport units, aspect-ratio
  • Font-family aliases (sans / serif / monospace)

Full CSS status →

JavaScript — Duktape 2.7.0 ES5

  • Closures, prototypes, regex, JSON
  • Promises (polyfill), recursion, Mandelbrot
  • ~6 sec ackermann(3,7) on a 233 MHz G3

Images — all five formats

  • PNG with real per-pixel alpha (lodepng + CopyMask)
  • GIF with palette transparency
  • JPEG, BMP, TIFF

Networking

  • Open Transport TCP, plain non-InContext calls
  • HTTP/1.1 + chunked + keep-alive + 3xx follow
  • Connection pooling, 15s no-progress timeout
  • HTTPS via Go proxy or native macSSL

Chrome

  • Address bar, back / forward / reload / home
  • Status bar, page-info, multi-window
  • Smooth scroll bar, keyboard scrolling

Download

Two StuffIt archives in builds/ — pick what you need:


Getting started

Building the browser

MacSurf is built on Mac OS 9 with CodeWarrior 8 Pro (8.3 update). Source is cross-compile-clean against Retro68 PowerPC GCC for fast Linux-side syntax checks.

Running the proxy

A single Go binary. No config files. No dependencies beyond stdlib.

cd proxy
go build -o macsurf-proxy
./macsurf-proxy

Documentation


Technical constraints

The platform sets the rules. MacSurf works around them, not against them.

  • Cooperative multitasking only. No preemptive threads anywhere. WaitNextEvent drives the UI; Open Transport synchronous calls yield via the Thread Manager on kOTSyncIdleEvent.
  • Strict C89. No inline, no //, no designated initializers, no variadic macros, no for-scope declarations. CW8 doesn't compile anything more modern.
  • No HTTPS in the browser (without macSSL). All TLS is handled by the proxy — the Mac speaks plain HTTP and the proxy bridges out to HTTPS.
  • 16 MB Carbon application partition. libcss allocates from the OS heap and runs out below ~12 MB on real pages.
  • Two memory floors: 64 MB RAM (development) on a G3 iMac, 256 MB+ (enthusiast tier) on G4 hardware.

Prior art

There was nothing here before. The netsurf-dev list has a single 2017 "Port to OS9?" thread with no follow-through. Best references the project was built against:

  • Classilla — the Mozilla-era reference Carbon browser. MacSurf borrows the 'carb' resource pattern and Open Transport architecture from Classilla's macsockotpt.c.
  • cy384/ssheven — production SSH client for OS 9; the canonical reference for cooperative-multitasking + Open Transport on real hardware.
  • cy384/miscellany — the shortest known-good OT HTTP client (~220 lines).

License

MacSurf is a derivative work of NetSurf and inherits its licensing terms: GPLv2 with the OpenSSL linking exception, plus MIT for visual artwork. The complete text is in LICENSE.

The Go proxy and macSSL ship under permissive licences — see each subproject for details.


MacSurf
Built with stubbornness for a 25-year-old operating system.

About

A modern web browser for Classic Mac OS 9 PowerPC. Real CSS3, ES5 JavaScript, native HTTPS — built with CodeWarrior on the Carbon API.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors