about summary refs log tree commit diff stats
path: root/src/local
Commit message (Collapse)AuthorAgeFilesLines
* env, client: fix fetch on Clientbptato2025-03-231-0/+3
|
* 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-132-7/+5
| | | | | | | | | | 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-122-8/+8
|
* Re-add JSValueConstbptato2025-03-122-15/+16
| | | | | | | | | 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...
* Update QuickJS-NG to 0.9.0bptato2025-03-111-1/+1
|
* tojs: misc cleanupbptato2025-03-071-2/+2
| | | | | | | * optimize toJS set * change defineProperty wrappers to return an enum If we're going to wrap defineProperty, then let's do it properly.
* 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-012-10/+10
| | | | | 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-263-51/+60
| | | | | | | | | | | | | 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
|
* select: do not reverse video on cursorbptato2025-02-201-0/+3
| | | | it looks ugly
* term: use so, se for reverse videobptato2025-02-201-3/+3
|
* fromjs, javascript: optimize out class name registrybptato2025-02-191-6/+6
| | | | | | | | Instead of hashing the class name for isInstanceOf, we now just reuse the Nim type pointer -> JSClassID map, which should be more efficient. This removes getClass and hasClass; these can be replaced by just reusing the class ID returned from registerType.
* render, pager: fix canvas background painting orderbptato2025-02-192-4/+18
| | | | | | | | | | 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-182-7/+22
| | | | ref. https://todo.sr.ht/~bptato/chawan/43
* client: remove client getterbptato2025-02-151-3/+0
| | | | Undocumented, plus and globalThis/window are enough.
* 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-152-13/+15
| | | | | Dump mode remains the same, except now it can be controlled in config.toml as well.
* catom: make factory globalbptato2025-02-131-1/+1
| | | | | This isn't great, but neither was passing around a pointer that pointed to a single object.
* pager: copy cursor position on meta refreshbptato2025-02-132-7/+8
|
* pager: remove (BUFFER) from prompt, hide alert promptbptato2025-02-091-6/+5
| | | | just a waste of space
* pager: existsDir -> dirExistsbptato2025-02-081-1/+1
|
* dom: various select fixes/improvementsbptato2025-02-082-1/+3
| | | | | | | | * do not trigger change event if selection did not change * do not destroy old selection on option insertion steps * position select popup correctly * reflectors for disabled attribute * immediately redraw container when select disappears
* pager: catch SIGINT for interrupt handlerbptato2025-02-052-44/+21
| | | | | | | | 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?
* term: simplify/optimizebptato2025-02-021-38/+34
| | | | by storing capabilities as strings instead of cstrings.
* 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
* buffer: drop pipe, pipe2, passFd privilegesbptato2025-01-301-0/+11
| | | | | All uses of these could be delegated to other processes with more privileges.
* 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.
* pager: fix gotoAnchor on buffers that were redirectedbptato2025-01-291-3/+4
| | | | | Redirection no longer preserves the previous cursor position, so gotoAnchor is now allowed to override it.
* lineedit: add missing nil check to nextHist, prevent empty entries in submitbptato2025-01-291-12/+9
| | | | | | | | | And clean up the function, while we're at it. ref. https://todo.sr.ht/~bptato/chawan/45 (The submit bug is unrelated, just something I discovered while testing nextHist & prevHist.)
* container: fix getSelectionText with no parametersbptato2025-01-291-7/+3
|
* loader: add download managerbptato2025-01-242-3/+20
| | | | | | Crude, but better than nothing. (I really wish the screen didn't flash on reload...)
* term: remove unused importbptato2025-01-241-1/+0
|
* buffer: support navigation on load/click, use origin for hover checkingbptato2025-01-241-2/+5
| | | | | | | Navigation from e.g. setTimeout still doesn't work. Also, the hover check now uses the auth origin instead of the host, and the auth origin now works for "file" as expected.
* buffer: improve screen state synchronizationbptato2025-01-232-38/+28
| | | | | | | | | | The intent behind the original design was that the page shouldn't change without user interaction. This sounds good in theory, but in practice it's unnecessary if you disable JS (nothing will modify the page), and annoying if you enable it (breaks pages that load with AJAX). So now we queue a task to notify us when the page has been updated, and act accordingly when the task is completed.
* term: re-add write overload for `string'bptato2025-01-231-0/+5
| | | | | | looks like we still need this fence ref. https://todo.sr.ht/~bptato/chawan/42
* pager, term: replace execCmd, Filebptato2025-01-222-45/+76
| | | | | | | | | | pager: I want to change mailcap command parsing, so a custom implementation is needed. term: now it uses a custom buffer for the output stream too. I don't think there is much difference in performance, but stdio was in the way. (Also, this way it will be easier to make it async in the future.)
* javascript: add .jsrget, .jsrfgetbptato2025-01-221-1/+1
| | | | Implements the [Replaceable] WebIDL property.
* pager: do not alert on failed history write if config dir doesn't existbptato2025-01-201-1/+4
| | | | ref. https://todo.sr.ht/~bptato/chawan/41
* container, config.toml: add | commandbptato2025-01-191-0/+6
| | | | | | Particularly useful when debugging minified JS. vi always wraps; the centering behavior is from vim.