about summary refs log tree commit diff stats
path: root/res
Commit message (Collapse)AuthorAgeFilesLines
...
* dom: add inline SVG supportbptato2024-12-201-2/+3
|
* img: add nanosvgbptato2024-12-193-0/+28
| | | | | | | | | | | | | | | | | | Only for SVG in image tags for now. Plus it comes with NanoSVG's limitations, i.e. no text. Still, better than nothing. I've gone through open tickets and PRs at upstream to check for known security issues. As a recurring theme I found that parseTransform fails to check the result of parseTransformArgs, so I fixed and refactored that part. (Probably not a security issue, but still UB.) Also, I've added a fix for an OOB read in parseColorRGB. Future directions: * replace nanosvgrast with our own rasterizer in canvas (will have to be extended somewhat...) * add text rendering (with unifont, which canvas already includes)
* pager: fix crash on gotoURL with save + mailcapbptato2024-12-191-1/+0
| | | | this broke saveImage
* ua.css: add margins to list items with high indicesbptato2024-12-171-0/+3
| | | | | | This is roughly what w3m does. Gecko instead adds enough space for roughly 4 digits and cuts off afterwards, but I believe this is a better solution.
* ua.css: fix checkbox decorationbptato2024-12-151-1/+1
|
* quirk.css: remove unimplemented propertiesbptato2024-12-151-4/+1
|
* Fix typobptato2024-12-151-1/+1
|
* chabookmark fixes & improvementsbptato2024-12-152-3/+6
| | | | | | | | * correct action on M-b * add external.bookmark option * move openFileExpand functionality into unquote * add menu items * update docs
* config.toml: move cmd definitionsbptato2024-12-151-228/+228
|
* Add chabookmark scriptbptato2024-12-142-17/+11
| | | | | | | | | | Finally it's done. It's basically w3mbookmark, but using Markdown instead of HTML and in POSIX shell instead of C. As a bonus, it can also (sort of) import w3mbookmark's output. Well, at least it worked on my bookmark file, but there is a known issue with bracket escaping... if it goes wrong, it's simple enough to edit it manually :P
* css: align h[1-6] behavior with w3mbptato2024-12-141-0/+1
| | | | | | | | | | | Implemented using proprietary selectors -cha-first-node and -cha-last-node, modeled after -moz-first-node and -moz-last-node. I think they are compatible. That does mean this is more limited than w3m's trimming, e.g. it can't really deal with nesting or empty tags. I think this is fine, as it's mainly meant for unstyled documents in the first place (which are unlikely to have e.g. MAIN tags).
* ua.css: underline all text typesbptato2024-12-141-13/+13
| | | | Since text is the fallback, just make it the default.
* pager, mailcap: misc fixes, add prompt for global mailcapbptato2024-12-111-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | In the past, Chawan would read global mailcap (/etc/mailcap, ...) too, but every now and then that would run entries that I didn't even know existed and definitely didn't intend to run. So I changed it to only use ~/.mailcap, but this meant users now had to add mailcap entries for every single mime type. At some point I also changed application/octet-stream to always save to disk, which is usually nice except when a text file is misrecognized as binary. Often times I just want to decide myself what to do. So now there are two layers. First, the global mailcap files (path as per RFC) prompt before executing. Then there is ~/.chawan/auto.mailcap (or ~/.config/chawan/auto.mailcap) which runs entries automatically. If you press shift before selecting an option in the prompt, the corresponding entry gets copied to auto.mailcap. It's also possible to type a new entry on the fly. Overall I think it's quite convenient. One unfortunate side effect is that existing users will have to migrate their entries to auto.mailcap, or redefine external.auto-mailcap to e.g. ~/.mailcap, but this seems acceptable.
* mimetypes: refactor, use mime.types for inline image extensionsbptato2024-12-051-1/+1
| | | | | | | | | | | | * remove std/streams use from mime.types; mmap and parse directly * use mime.types for inline image extensions * add some jpeg file extensions Latter came up because I was trying to add a format locally and it wouldn't recognize it on images from my file system (i.e. by extension). As a security measure we still do not allow additional extensions for predefined inline image types.
* config: add copy-cmd, paste-cmdbptato2024-12-011-10/+12
| | | | ref. https://todo.sr.ht/~bptato/chawan/29
* pager: do not make pointless requests in viewImage, add saveImagebptato2024-11-302-4/+12
| | | | | | | with buffer.images enabled, we already cache them, so we can skip the additional request also, add saveImage, bound to sI
* ua.css: add nobrbptato2024-11-301-0/+2
|
* mailcap: add x-needsstyle extension fieldbptato2024-11-271-2/+2
| | | | | | | Useful when an x-htmloutput handler needs styling for the HTML output to be formatted correctly (as a sort of pseudo-ua style sheet). ref. https://todo.sr.ht/~bptato/chawan/28
* layout: support br clearbptato2024-11-271-0/+4
|
* ua.css: reformatbptato2024-11-251-329/+98
|
* buffer: proper toggleImages implementationbptato2024-11-211-0/+1
| | | | | | | It necessarily removes the config.images check from codec access, which I'm not quite happy about, so I've added a check to the DOM instead. (TODO: maybe pager should just dynamically grant codec access as a capability instead? but maybe that's even more error prone...)
* ua.css, event: small clean upbptato2024-11-181-4/+4
|
* ua.css: set fieldset to flow-rootbptato2024-11-181-0/+4
| | | | | The HTML standard wants us to treat it specially, but for now this seems to work OK too.
* res: remove unicode tablesbptato2024-11-133-11885/+2
| | | | | mainly to avoid licensing issues and to skip an unnecessary build step when the git repo is cloned
* config.toml: respect TMPDIRbptato2024-11-121-3/+3
| | | | | also, fix a bug in the chapath parser so that param expansion actually works
* cascade: adjust prefers-color-scheme based on terminal backgroundbptato2024-11-101-0/+7
| | | | also, default link color is now blue for light terminal backgrounds
* utils, types: merge some modulesbptato2024-11-031-1/+1
| | | | | * line, vector, matrix -> path * twtuni, charcategory -> twtstr
* config: refactor, accept more possible config dirsbptato2024-10-281-1/+1
| | | | | | | | | | | | | | | | | | | | | I'm starting to favor dotfiles over XDG basedirs, but there's no reason why we couldn't have both. So now the search path is: 0. if config was set through -C, use that 1. $CHA_CONFIG_DIR is set -> $CHA_CONFIG_DIR/config.toml 2. $XDG_CONFIG_HOME is set -> $XDG_CONFIG_HOME/chawan/config.toml 3. ~/.config/chawan/config.toml exists -> use that 4. ~/.chawan/config.toml exists -> use that Notably, this makes it so the default directory is ~/.chawan *if* you don't have an existing config.toml file. So in that case known_hosts will be placed in ~/.chawan/known_hosts. However, configurations with a config in ~/.config/chawan/config.toml continue to work as expected, as for those the known_hosts file remains inside ~/.config/chawan/. Finally, I've added a default user CGI directory to reduce friction in setting CGI up. (Like known_hosts, it's also relative to whatever config dir you have.)
* sandbox: replace libseccomp with chaseccompbptato2024-10-231-3/+2
| | | | | | | | | | | | | | | This drops libseccomp as a dependency. Also, move the capsicum/pledge definitions from bindings to sandbox.nim because they are only used there. Interestingly, after integrating chaseccomp I found that the stbi process would mysteriously crash by a getrandom(2) syscall. Closer investigation revealed it is only called on the initialization of glibc's malloc; presumably it had never surfaced before because libseccomp would always allocate before entering the sandbox. So I've added getrandom to our filter as well.
* ua.css: disable reverse video on <code> in <pre>bptato2024-10-211-0/+4
| | | | | | | | | | | | The intention is that only inline code tags have reverse video; otherwise it often messes with syntax highlighting. I've made it a descendant selector (instead of a cheaper parent selector) because I can easily imagine markup like <pre><div><code>... which really shouldn't enable reverse video either.
* config.toml: add ?q=/path Google redirectbptato2024-10-181-2/+6
| | | | apparently this is relative to the current page
* css: add reverse video extensionbptato2024-10-151-0/+4
| | | | | | | | | | | | Called -cha-reverse. Mostly to solve the problem that code tags are indistinguishable from regular text - on a graphical browser this is normally served by monospace font, but we always use monospace... So now the default ua.css adds reverse video to code and xmp. pre remains as it was, because it means "preformatted", not "monospaced". Also, it would mess with our whatever-to-HTML converter output.
* Add `nc' tool & adjust finger/spartan to use itbptato2024-10-121-1/+1
| | | | | | | | | Simple netcat clone, useful for portable scripts. Especially because some netcats will close the connection as soon as I close stdin... this one only quits when either stdout or the socket refuses new data. Also, it uses our standard TCP connection routine, meaning it respects ALL_PROXY. (i.e. now spartan works with socks5 too)
* dirlist: separate out into dirlist2htmlbptato2024-10-121-0/+1
| | | | | Now the dirlist parser lives inside dirlist2html, and the file protocol just emulates FTP LIST.
* gmifetch: rewrite in Nimbptato2024-10-121-1/+1
| | | | | | | | | | This finally makes it possible to use socks5 for Gemini. Also slightly refactored the config, to make it easier to pass on the config dir. By the way, the known_hosts file is now stored in the config dir too. The adapter will try to move it to there from the old location.
* ftp: remove libcurl dependencybptato2024-10-011-2/+1
| | | | | | | | | | | | | This splits out sftp into a separate binary that *does* depend on libcurl. However, ftp now uses the same socket code as gopher. ftps is dropped, because I've never even tested it. Maybe I'll add it back when we have working OpenSSL bindings. This is still "doing the easy part first", now I have no clue how to handle sftp because my initial plan ("just use the sftp binary") doesn't work - sftp batch mode doesn't accept passwords. libssh2 remains the sole candidate, but that's what libcurl wraps anyway.
* config.toml: switch to Google searchbptato2024-09-301-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I'm not happy about this, but the alternatives are worse. * DDG has degraded a lot lately: - (I think?) it appends my location to the Bing queries, which might be useful for searching restaurants, but only increases noise when looking for something technical. - Lately it also shoves LLM-generated summaries of websites in my face - which I wouldn't even mind if the "summaries" weren't in the typical overly verbose LLM style... Also, not a degradation per se, but DDG can't load images without JS (neither lite nor html), while Google can. Only relevant now that we have images. * Other large search providers either don't load without JS, or give us a layout that we can't render. * Smaller search providers (Mojeek, Marginalia) sadly don't have CJK support. (DDG performs quite poorly here, too.) * Metasearch engines (Searx, etc.) require self-hosting to work consistently, which I lack resources for. I'm sending ucbcb=1 and gbv=1, both of which are appended by Google and apparently stand for "no cookies" and "no JS", respectively. Also, I have added a siteconf entry to strip the click tracking. The default ddg: omni-rule remains, so users who wish to switch back can set in config.toml: [page] C-k = '() => pager.load("ddg:")'
* Update monouchabptato2024-09-291-3/+5
| | | | | Now we use QuickJS-NG, which is better maintained than QJS and has column tracking.
* gopher: do not depend on libcurlbptato2024-09-281-1/+0
| | | | | | | | I'm thinking of making libcurl entirely optional; let's start with the easiest part. I've added a SOCKS5 client for ALL_PROXY support; I know curl supported others too, but whatever.
* Update docsbptato2024-09-261-0/+2
|
* pager: improve hover text handlingbptato2024-09-222-8/+9
| | | | | | | | | | | * align status truncating behavior with w3m (not exactly, clipping is still different, but this should be fine for now) * add "su" for "show last alert" - w3m's solution here is to scroll one char at a time with "u", but that's extremely annoying to use. We already have a line editor that can navigate lines, so reuse that instead. * fix peekCursor showing empty text * update todo
* Update to Unicode 16.0.0bptato2024-09-144-12882/+13154
|
* config: add display.sixel-colorsbptato2024-09-101-0/+1
|
* config: fix broken references to commandsbptato2024-09-101-1/+1
|
* pager: fix saveSourcebptato2024-09-101-1/+1
| | | | | | Welp. The fence was needed after all. The keybinding was broken anyway; fix that too.
* md2html: code, pre, inline fixesbptato2024-09-071-1/+1
|
* url: reduce idna sizebptato2024-09-012-2148/+1171
| | | | | Instead of storing pointers to cstrings, put all of them in a single huge string and store indices of that.
* canvas: move to separate CGI scriptbptato2024-09-011-0/+1
| | | | | | | | | | * stream: and passFd is now client-based, and accessible for buffers * Bitmap's width & height is now int, not uint64 * no more non-network Bitmap special case in the pager for canvas I just shoehorned it into the static image model, so it still doesn't render changes after page load. But at least now it doesn't crash the browser.
* sixel: break out into a separate cgi scriptbptato2024-08-241-0/+1
| | | | | | | | This caches sixel output. Works best when the line height is a multiple of 6px, but should still be faster than the previous solution everywhere else too (simply by virtue of encoding separate images in parallel). Next step: actual color quantization
* loader: move back data URL handlingbptato2024-08-031-1/+0
| | | | | | | data URIs can get megabytes long; however, you can only stuff so many bytes into the envp. (This was thwarting my efforts to view pandoc- generated standalone HTML in Chawan.) So put `data:' back into the loader process.