about summary refs log tree commit diff stats
path: root/src/local/pager.nim
Commit message (Collapse)AuthorAgeFilesLines
* config: print warning for prepend-httpsbptato2025-05-131-1/+1
| | | | Use prepend-scheme = '' instead.
* Eliminate some superfluous copiesbptato2025-05-111-4/+4
|
* Enable ProveInit warningbptato2025-05-101-3/+8
| | | | It has caught some minor bugs.
* config: add external.show-download-panelbptato2025-05-091-3/+3
|
* pager: remove pointless clampbptato2025-05-081-2/+1
|
* term: remove sixelMaxWidth, sixelMaxHeightbptato2025-05-071-1/+1
| | | | | | We weren't compensating for it at all, so it's kind of pointless. (AFAIK it only ever differs from the window size on XTerm, where you can just set maxGraphicSize anyway.)
* url: add schemeType, fix port bug on protocol assignmentbptato2025-05-031-9/+11
| | | | Allows branching on the scheme without string comparisons.
* pager: do not forget downloads buffer on replacebptato2025-05-021-0/+2
|
* container: optimize object sizebptato2025-05-021-3/+3
|
* history: simplify a bitbptato2025-04-301-1/+1
|
* pager: remove obsolete acceptBuffersbptato2025-04-171-28/+14
| | | | Hopefully this didn't break anything...
* pager: remove unused fieldbptato2025-04-171-7/+6
|
* loaderiface: return PosixStream for startRequestbptato2025-04-151-1/+1
|
* pager: pin downloads panelbptato2025-04-151-2/+8
| | | | and make it autorefresh so the UX is halfway sane
* loader: remove target pid from addCacheFilebptato2025-04-151-2/+4
| | | | I wonder if it would be better to just resume in the buffer.
* pager, formdata: DynStream -> PosixStreambptato2025-04-141-1/+1
|
* loader, pager: fix login with username onlybptato2025-04-131-1/+1
| | | | | | It's a bit tricky, because "username only" means "try with the username only" only if no password has been recorded for the username on the origin.
* loader: remove referrer field from Requestbptato2025-04-131-2/+3
| | | | It's OK to store it in headers.
* pager: reduce passFd callsbptato2025-04-131-26/+24
| | | | addPipe is unprivileged and preferable in general.
* config: unify table arrays and tablesbptato2025-04-111-3/+3
| | | | | | | | | | | | | | | | | | [[siteconf]] now just means [siteconf.0], etc. So you can now override parts of default siteconfs/omnirules, e.g. to change the Google search substitute-url, etc. To celebrate this, I've added some more default search engines: * wk: -> Wikipedia * wd: -> Wiktionary * ms: -> Marginalia Search These can be replaced by setting e.g. omnirule.wk = {}, etc. Also, siteconf = {} can be used to clear pre-defined siteconfs. This is an unfortunate deviation in semantics from TOML, but in practice the way it worked before didn't match the spec either, so at least it is now consistent.
* loader: support Set-Cookie for non-initial requestsbptato2025-04-051-19/+80
| | | | | | | | | For compatibility with mainstream browsers. e.g. this should allow log-ins through ajax. To synchronize the loader's cookie jar with that of the pager, we open a stream (about:cookie-stream) to pass over serialized cookies when required.
* mailcap: various fixesbptato2025-04-041-1/+1
| | | | | | | * print path on error (like in toml) * fix line tracking * accept non-ASCII commands * (also adjusted some error messages in config & toml)
* config: add user-style, deprecate [css] and stylesheetbptato2025-04-011-3/+5
| | | | | I'm not 100% content with this syntax either, but it's a significant improvement over the previous solution.
* jsutils: add toJSValueConstArray, toJSValueConstOpenArraybptato2025-03-211-1/+1
|
* pager: remove unnecessary castbptato2025-03-211-1/+1
|
* loader, forkserver: launch CGI processes from fork serverbptato2025-03-141-1/+1
| | | | | | | | | | Well, it's not much prettier... but it will be useful for keep-alive. (Hopefully.) Also, loader could now be locked down capsicum/pledge/seccomp, but I'm not sure if there's a point. The biggest potential threat it faces is cross-contamination of handles, and no amount of syscall filtering is going to protect against that.
* forkserver: clean up, do not panic on forkBuffer failurebptato2025-03-141-7/+11
| | | | | | | | | I've removed the SIGINT trap because the fork server is now in a separate process group than the main process anyway. We'll see if this actually works... Also realized we weren't closing the fork server's control stream on fork; now we do.
* forkserver: simplify & improve process cleanupbptato2025-03-131-5/+3
| | | | | | | | | | Instead of trying to track child pids (which is wrong - a child may die at any time for whatever reason, so we could have ended up murdering some random process that took its place...), just setsid on forkserver start and send SIGTERM to the entire process group on termination. Also removed the loader pid from the FileLoader object, as it is no longer useful.
* headers: hide table, always specify guardbptato2025-03-121-5/+5
|
* Re-add JSValueConstbptato2025-03-121-11/+12
| | | | | | | | | This time, I've also ported over the consistency check to prevent some ownership bugs. Unfortunately, the check is very limited, and it is still possible to double-free or leak JSValues. I think it would be possible to make coverage 100%, but only with ARC...
* history, cookie: fsync before renamebptato2025-03-061-1/+1
| | | | | In theory, it is possible for rename to succeed before the buffers are flushed, and then we lose data.
* pager: flush console after logging resultbptato2025-03-051-0/+1
|
* loader: merge status and header packetsbptato2025-03-011-8/+3
| | | | | | | We sent the two packets at the same time anyway. (Status could have been sent earlier in some cases, but there is no point - it's unused until after all headers have been received.)
* Refactor bufreader, bufwriterbptato2025-03-011-5/+5
| | | | | This adds a runtime check to packet readers to ensure that all fds have been read, and switches to seqs for packet writers.
* dynstream, console: remove DynFileStreambptato2025-02-261-18/+18
| | | | | Conflating buffered streams with non-buffered streams is generally a bad idea.
* dynstream: remove exceptionsbptato2025-02-261-41/+32
| | | | | | | | | | | | | Now we just pass down the value of n and check errno, plus readDataLoop/writeDataLoop returns a bool indicating whether it failed. For now this seems to work OK, but maybe I'll add a better abstraction in the future. EOFError is still used for handling failed packets; this is brittle, and should be replaced once we have a proper buffering mechanism for them. (That will also let us kill BufStream.) Unrelated: this also fixes a bug in buffer with cacheId.
* tempfile: merge into pager/loaderbptato2025-02-251-2/+9
| | | | | | | | and throw out the conflict resolution logic; it doesn't matter much if we override an old cache file, as it should have been cleaned up anyway. I've also replaced dirExists + createDir with a single mkdir at call sites. If it fails, so be it.
* pager: inherit history flag on reloadbptato2025-02-211-1/+2
|
* pager: add API to set search regexbptato2025-02-201-4/+18
|
* render, pager: fix canvas background painting orderbptato2025-02-191-2/+13
| | | | | | | | | | We were painting the background box in render for dump mode, but this conflicted with the standard requirement that the canvas be painted before other elements. So now we handle this directly in the pager. Conveniently enough, this also fixes the issue of canvas color adding pointless spacing to pages (which often made the selection feature less useful.)
* Add mark-links featurebptato2025-02-181-1/+4
| | | | ref. https://todo.sr.ht/~bptato/chawan/43
* xhr, event, catom: fix some bugsbptato2025-02-151-1/+1
| | | | Event handler functions can be set twice now.
* buffer: wait for scripts in headless modebptato2025-02-151-12/+14
| | | | | Dump mode remains the same, except now it can be controlled in config.toml as well.
* pager: copy cursor position on meta refreshbptato2025-02-131-6/+7
|
* pager: remove (BUFFER) from prompt, hide alert promptbptato2025-02-091-6/+5
| | | | just a waste of space
* pager: existsDir -> dirExistsbptato2025-02-081-1/+1
|
* pager: catch SIGINT for interrupt handlerbptato2025-02-051-16/+5
| | | | | | | | Significantly more efficient in long running commands (as the context switch is gone). For many commands in quick succession... it replaces the fcntl with a tcsetattr, so I guess it's the same?
* dom, layout: fix empty canvas cache idsbptato2025-02-011-6/+8
| | | | ok now I understand why I made shareCachedItem crash...
* dom: basic module supportbptato2025-02-011-39/+13
| | | | probably breaks with TLA
* about: move to loaderbptato2025-01-301-1/+1
| | | | | This means we can now use about:downloads for downloads. Plus it shaves off some ks from the distribution.