about summary refs log tree commit diff stats
path: root/res
Commit message (Collapse)AuthorAgeFilesLines
* buffer, pager, config: add meta-refresh + misc fixesbptato2024-07-281-0/+1
| | | | | | | | | * buffer, pager, config: add meta-refresh value, which makes it possible to follow http-equiv=refresh META tags. * config: clean up redundant format mode parser * timeout: accept varargs for params to pass on to functions * pager: add "options" dict to JS gotoURL * twtstr: remove redundant startsWithNoCase
* img: add webp decoder (jebp)bptato2024-07-203-0/+28
| | | | | | | | | | It works fine AFAICT, just missing VP8 deblocking filters, so lossy WebP images don't look great. I have extended the API a bit to allow reading from stdin, not just paths. Otherwise, it's the same as matanui159/jebp. TODO: add loop filters
* config: support smart casebptato2024-07-161-1/+1
| | | | and enable it by default.
* fix compilation on 2.0.8bptato2024-07-101-1/+1
|
* main: misc improvementsbptato2024-07-051-2/+1
|
* config: add various missing optionsbptato2024-06-291-0/+7
| | | | | | | Mainly things you could already set with [[siteconf]] but not normally. Also, a `styling' option to disable author styles. Also, `images' is now documented as an "experimental" option, since it's halfway usable now.
* img, loader: add image resizing, misc fixesbptato2024-06-281-3/+4
| | | | | | | | | | | | | | | * resize images with stb_image_resize * use tee for output handle redirection (redirectToFile blocks) * cache original image files * accept lseek in sandbox * misc stbi fixes For now, I just pulled in stb_image_resize v1. v2 is an extra 150K in size, not sure if it's worth the cost. (Either way, we can always switch later if needed, since the API is almost the same.) Next step: move sixel/kitty encoders to CGI, and cache their output in memory instead of the intermediate RGBA representation.
* stbi: add encodersbptato2024-06-211-2/+3
|
* img, term: try to detect unknown images, improve kitty encoderbptato2024-06-211-20/+21
| | | | | | * preserve alpha in kitty + simplify encoder * pass unknown image types to stbi (as image/x-unknown) and let it detect the type
* img: use stb_image, drop zlib as dependencybptato2024-06-203-6/+18
| | | | | | | Now we have decoders for gif, jpeg, bmp. Also, the in-house PNG decoder has been replaced in favor of the stbi implementation; this means we no longer depend on zlib, since stbi comes with a built in inflate implementation.
* img, loader: separate out png codec into cgi, misc improvementsbptato2024-06-201-0/+1
| | | | | | | | | | | | | | | * multi-processed and sandboxed PNG decoding & encoding (through local CGI) * improved request body passing (including support for output id as response body) * simplified & faster blob()/text() - now every request starts suspended, and OngoingData.buf has been replaced with loader's buffering capability * image caching: we no longer pull bitmaps from the container after every single getLines call Next steps: replace our bespoke PNG decoder with something more usable, add other decoders, and make them stream.
* pager: send Accept: */* for viewImagebptato2024-06-081-1/+8
|
* pager, buffer: improve forms, protocol configbptato2024-06-081-0/+9
| | | | | | * refactor form submission * add options to specify form handling per protocol * block cross-protocol POST requests
* config.toml: update headersbptato2024-06-081-2/+2
| | | | | | | | | * prepend Mozilla/5.0 to User-Agent; an unfortunate fact is that even the G-lettered search engine breaks without it, and I've seen sites that refuse to serve pages at all. * Add */* to Accept, in the hope that we'll get images more often. (The ideal solution is to set it to "*/*" when fetching images, but the API format doesn't let us do this yet; TODO.)
* pager: rework D/discard bufferbptato2024-05-312-1/+8
| | | | | | | | | | | | | | | | | | | | | The previous solution had the issue that it switched between "delete buffer, then move back" and "delete buffer, then move forward" depending on whether the buffer was the root of the buffer tree, which made its behavior quite unpredictable. Now the pager (sort of) remembers the direction you are coming from, and D moves in that direction. So e.g.: * Enter, D just moves back to where you were coming from (as before) * Comma, D deletes the previous buffer, then returns to the current buffer If no buffer exists in the target direction, then we alert. Also, new commands are: `d,' `d.'. They do the same thing the non-d-prefixed variations do, but also delete the current buffer. Useful if you're no longer sure where you are coming from, but know where you want to go. (`d,' in particular is equivalent to w3m's `B'.)
* about: markdownify & update license.htmlbptato2024-05-281-41/+36
| | | | We have a markdown converter, so why not use it?
* Update docsbptato2024-05-161-2/+2
|
* config: separate tmp dir for sockets, usersbptato2024-05-161-1/+2
| | | | | | | * add $LOGNAME to the tmp directory name, so that tmpdirs of separate users don't conflict * use separate directory for sockets, so that we do not have to give buffers access to all cached pages
* pager: editor command fixesbptato2024-05-121-1/+1
|
* Fix typobptato2024-05-111-1/+2
|
* pager: take $EDITOR from envbptato2024-05-111-1/+1
| | | | | | * use EDITOR environment variable in default config, fix line number ordering in fallback * autodetect vi-like editors and add line number
* term: optimize canvas redraw, remove emulate-overlinebptato2024-05-101-1/+0
| | | | | | | * Replaced the `pcanvas' comparison with a much simpler tracking of the first damaged cell in writeGrid, which is significantly faster. * Removed emulate-overline: it's of too little utility compared to the maintenance burden it caused.
* js: fix various leaks etc.bptato2024-05-032-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously we didn't actually free the main JS runtime, probably because you can't do this without first waiting for JS to unwind the stack. (This has the unfortunate effect that code now *can* run after quit(). TODO: find a fix for this.) This isn't a huge problem per se, we only have one of these and the OS can clean it up. However, it also disabled the JS_FreeRuntime leak check, which resulted in sieve-like behavior (manual refcounting is a pain). So now we choose the other tradeoff: quit no longer runs exitnow, but it waits for the event loop to run to the end and only then exits the browser. Then, before exit we free the JS context & runtime, and also all JS values allocated by config. Fixes: * fix `ad' flag not being set for just one siteconf/omnirule * fix various leaks (since leak check is enabled now) * use ptr UncheckedArray[JSValue] for QJS bindings that take an array * allow JSAtom in jsgetprop etc., also disallow int types other than uint32 * do not set a destructor for globals
* css, dom: simplify ident parsing, canvas fixesbptato2024-05-011-1/+1
| | | | | | | | * add CSSStyleDeclaration setter * move ident maps directly into enums * more complete CSSComputedValue stringifier * turn canvas into a pseudo-image in cascade * set canvas to inline-block
* ua.css: style xmp like prebptato2024-04-271-1/+1
|
* config: fix copy image URL, document copy commandsbptato2024-04-271-1/+1
|
* buffer: add toggleImagesbptato2024-04-271-0/+2
|
* Initial image supportbptato2024-04-251-0/+1
| | | | | | | | | | | | | | | | | * png: add missing filters, various decoder fixes * term: fix kitty response interpretation, add support for kitty image detection * buffer, pager: initial image display support Emphasis on "initial"; it only "works" with kitty output and PNG input. Also, it's excruciatingly slow, and repaints images way too often. Left undocumented intentionally it for now, until it actually becomes useful. In the meantime, adventurous users can find out themselves why: [[siteconf]] url = "https://.*" images = true
* ua.css: use padding for lists, not marginbptato2024-04-031-1/+1
| | | | | FF does it this way as well, and it seems sr.ht depends on it being padding instead of margin.
* pager: edit source fixesbptato2024-03-301-1/+1
| | | | | | | * URI-decode path name for local files in default config * (ab)use mailcap command quoting for passing params to editor command instead of replicating it badly in formatEditorName * rename mailcap enums
* ansi2html: support passing titlesbptato2024-03-291-1/+1
| | | | | | | Use content type attributes so e.g. git.cgi can set the title even with a text/x-ansi content type. (This commit also fixes some bugs in content type attribute handling.)
* config: improve input systembptato2024-03-262-215/+344
| | | | as described in <https://todo.sr.ht/~bptato/chawan/6>
* ansi2html: add separate switch for "standalone"bptato2024-03-211-1/+1
| | | | | this way its output can be embedded into documents without a pointless DT declaration
* pager: add "save link", "save source"; change & document some keybindingsbptato2024-03-202-9/+18
| | | | | | | | | * `s{Enter}' now saves link, and `sS' saves source. * Changed ;, +, @ to g0, g$, gc so that it's somewhat consistent with vim (and won't conflict with ; for "repeat jump to char") * Changed (, ) to -, + so that it doesn't conflict with vi's "previous/next sentence" (once we have it...) * Add previously missing keybindings to about:chawan
* config: remove system mailcaps from default mailcap pathbptato2024-03-191-4/+1
| | | | | | | | I haven't seen a single OS-shipped mailcap file yet that would be suitable for use with Chawan. The one on Debian wants to open every text file with vim; the one in FreeBSD ports is straight up broken. mime.types works much better and thus stays.
* main: set CHA_LIBEXEC_DIR env var at startupbptato2024-03-191-0/+6
| | | | This way, we can use it everywhere (e.g. in mailcap).
* urimethodmap: do not set query string for gmifetchbptato2024-03-191-1/+1
| | | | we use MAPPED_URI_* now
* buffer: add markURLbptato2024-03-192-0/+2
| | | | Useful when browsing plaintext files; w3m has it too.
* urimethodmap: fix sftp, ftpsbptato2024-03-191-2/+2
| | | | they all use the same CGI script (with varying success)
* pager, loader: add "Save file to" functionalitybptato2024-03-161-1/+2
| | | | | | | As simple as it could be; no download panel yet. Also, remove the xdg-open default mailcap entry; it's better to just save by default.
* config: add start.console-buffer optionbptato2024-03-161-0/+1
| | | | useful for debugging
* config.toml: fix sE bindingbptato2024-03-151-1/+1
|
* pager: add "open in editor" keybinding (sE)bptato2024-03-142-0/+9
| | | | | | only for source for now, rendered document is a bit more complicated (also, get rid of useless extern/editor module)
* man: misc improvementsbptato2024-03-141-3/+3
| | | | | | | * do not use query string for arguments * accept symlinks as man binaries * improve error message reporting * run all regexes on the original line
* rudimentary support for <video>, <audio>bptato2024-03-131-1/+1
| | | | | we just treat them as img tags. lazy, but works suprisingly well -- so long as the server sends us a Content-Type, anyway.
* man: rewrite in Nimbptato2024-03-131-18/+0
| | | | | | | | | | | | Depending on Perl just for this is silly. Now we use libregexp for filtering basically the same things as w3mman2html did. This required another patch to QuickJS to avoid pulling in the entire JS engine, but in return, we can now run regexes without a dummy JS context global variable. Also, man.nim now tries to find a man command on the system even if it's not in /usr/bin/man.
* strwidth, renderdocument: small refactoringbptato2024-03-032-132/+449
| | | | | | * put attrs pointer in state * simplify width() * use unsigned int as ptint to avoid UB
* css: remove caption-side: left, right, fix caption-side: bottombptato2024-03-011-8/+0
| | | | | | | | left/right never really worked correctly, is non-standard, and the only browser that supported it (Firefox) removed it years ago. bottom was adding the table width to its offset instead of the height, that is now fixed.
* Add mouse supportbptato2024-02-291-0/+1
|
* pager: improve URL loading procsbptato2024-02-281-3/+3
| | | | | | | Split up load into loadSubmit, gotoURL: loadSubmit is a replacement for load(s + '\n'), and gotoURL is a load that does no URL expansion. Also, fix a bug where load("\n") would crash the browser.