Mini Browser
A compact, text-oriented web browser for the WHY2025 badge.
Mini Browser is a lightweight, SDL-based browser that retrieves and renders plain text web pages.
It is designed for constrained environments where speed, memory efficiency, and simplicity are essential.
----------------------------------------
Features
- Link navigation
All <a href> targets are extracted and indexed numerically as [n].
Use Tab / Shift+Tab to select a link, and Enter to open it.
- Direct URL input
Type into the address bar, press Enter to navigate.
Bare hostnames are automatically expanded (e.g. example.org -> https://example.org).
- Redirect handling
Supports standard HTTP 3xx redirects.
- Relative URL resolution
Handles relative paths (/foo, ../bar, //host/...) against the active base URL.
- Entity decoding
Decodes common HTML entities (&, <, >, ", ', ).
- Keyboard-only interface
Fully controlled using the badge keyboard.
----------------------------------------
Keyboard Controls
- Typing: edits the URL in the bar (ASCII only)
- Enter: navigate to typed URL, or follow the currently selected [n] link
- Backspace: delete last character in the URL bar
- Down / J: scroll down | Up / K: scroll up
- PageDown / PageUp: scroll a page at a time | Home: jump to top
- Tab: select next link | Shift+Tab: select previous link
- Esc: quit
WHY key (accelerator) combos - hold the WHY (0xE3) key and press:
- E -> Edit: prefill URL with
https://
- H -> Home: go to the home page
- R -> Reload the current page
- B -> Back in history
- Q -> Quit
----------------------------------------
Special Keys
These dedicated keys provide instant navigation:
----------------------------------------
Implementation Overview
- Fetch: pages retrieved with libcurl (up to 64 KB by default).
- Parse: minimal HTML walker:
- skips <head>, <script>, <style>
- collapses whitespace and decodes entities
- extracts and indexes links
- Wrap: text wrapped to fit viewport width using a fixed 5x7 bitmap font.
- Render: SDL draws the address bar, separators, and text viewport.
----------------------------------------
Known Limitations
- No CSS/JS/Images - purely text output.
- ASCII focus - non-ASCII simplified to ?.
- No cookies or sessions - no persistence across requests.
- Content cap - maximum page size 64 KB.
----------------------------------------
Recommended Sites
----------------------------------------
Credits
- Built on BadgeVMS, SDL, and libcurl.
- Font: custom 5x7 ASCII bitmap.
- Developed for the WHY2025 badge community.
- Lots of copy and paste example code ... but it seems to work.