@mizchi/crater-browser 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -0
- package/dist/crater-browser.js +12 -0
- package/package.json +38 -0
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Crater Browser (Experimental)
|
|
2
|
+
|
|
3
|
+
An highly experimental TUI browser implemented in MoonBit from scratch.
|
|
4
|
+
|
|
5
|
+
**Warning: This is an experimental implementation and is not intended for production use.**
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- HTML parsing and rendering
|
|
10
|
+
- External CSS fetching and application
|
|
11
|
+
- [ ] Sixel graphics output (with `--sixel` flag)
|
|
12
|
+
- TUI text mode rendering (with `--text` flag)
|
|
13
|
+
- Image placeholders with alt text display
|
|
14
|
+
- Gray background with borders for image areas
|
|
15
|
+
- Basic keyboard navigation
|
|
16
|
+
- [ ] Link navigation with Tab/Shift+Tab
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install -g @mizchi/crater-browser
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npx @mizchi/crater-browser <URL> [--sixel] [--debug]
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Usage Example
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx @mizchi/crater-browser https://www.cnn.co.jp/fringe/35129835.html
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Options
|
|
37
|
+
|
|
38
|
+
- `--text`: TUI text mode (default)
|
|
39
|
+
- `--sixel`: Sixel graphics mode (requires sixel-capable terminal)
|
|
40
|
+
- `--debug`: Print layout tree for debugging
|
|
41
|
+
|
|
42
|
+
### Development
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
cd browser
|
|
46
|
+
moon run src/main --target js -- https://example.com
|
|
47
|
+
moon run src/main --target js -- --sixel https://example.com
|
|
48
|
+
moon run src/main --target js -- --debug https://example.com
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Key Bindings
|
|
52
|
+
|
|
53
|
+
### Navigation
|
|
54
|
+
|
|
55
|
+
- `j` / `Down`: Scroll down
|
|
56
|
+
- `k` / `Up`: Scroll up
|
|
57
|
+
- `Ctrl-D` / `PageDown`: Page down (scroll by one screen)
|
|
58
|
+
- `PageUp`: Page up (scroll by one screen)
|
|
59
|
+
- `H` / `Backspace` / `Delete`: Go back to previous page
|
|
60
|
+
- `L`: Go forward to next page
|
|
61
|
+
|
|
62
|
+
### Links
|
|
63
|
+
- `Tab` / `n`: Next link
|
|
64
|
+
- `Shift+Tab` / `N` / `p`: Previous link
|
|
65
|
+
- `Enter`: Activate focused link
|
|
66
|
+
- `f`: Hit-a-hint mode (shows labels on links, type to navigate)
|
|
67
|
+
|
|
68
|
+
### General
|
|
69
|
+
- `g`: Go to URL (opens prompt)
|
|
70
|
+
- `r`: Reload current page
|
|
71
|
+
- `q`: Quit
|
|
72
|
+
- `Escape`: Exit hint mode
|
|
73
|
+
|
|
74
|
+
### Hit-a-Hint Mode
|
|
75
|
+
|
|
76
|
+
Press `f` to enter hint mode. All visible links will be labeled with characters (a-z). Type the label to navigate to that link. Press `Escape` to cancel.
|
|
77
|
+
|
|
78
|
+
For pages with more than 26 links, two-character labels (aa, ab, etc.) are used.
|
|
79
|
+
|
|
80
|
+
## Limitations
|
|
81
|
+
|
|
82
|
+
- JavaScript is not executed
|
|
83
|
+
- Only a subset of CSS properties are supported
|
|
84
|
+
- Images shown as placeholders (not actual image rendering in TUI mode)
|
|
85
|
+
- Some CSS layout features (grid, advanced flexbox) are partial
|
|
86
|
+
|
|
87
|
+
## TODO
|
|
88
|
+
|
|
89
|
+
- [ ] Static asset cache
|
|
90
|
+
- [ ] Show visited/unvisited link colors
|
|
91
|
+
- [ ] Tab text focus and preview
|
|
92
|
+
- [ ] Fix j/k scroll layout
|
|
93
|
+
- [ ] Access and scroll to content by AOM (Accessibility Object Model)
|
|
94
|
+
- [ ] Text search (Ctrl+F)
|
|
95
|
+
- [x] Hit-a-hint (implemented)
|
|
96
|
+
- [ ] Mouse click link navigation (WIP - hit testing not working correctly)
|