about summary refs log tree commit diff stats
path: root/src/loader
Commit message (Collapse)AuthorAgeFilesLines
* dom: use JS_EvalFunction; add module fetching stubsbptato2023-12-251-1/+3
| | | | (still no module support in buffer...)
* cgi: return ConnectionError when script is not executablebptato2023-12-212-1/+3
|
* loader: refactor onRead/onErrorbptato2023-12-211-19/+22
| | | | | | It was originally written this way to accomodate for the broken std file API. We no longer use that in buffer, so we can use a more correct version now.
* Implement local CGI error message handlingbptato2023-12-154-3/+31
| | | | | | This was documented, but not implemented until now. Also, improve the loader module's protocol documentation.
* loaderhandle: fix ConversionDefect in getFdbptato2023-12-131-2/+7
| | | | | We must save fd in the constructor, because the stream type may be changed while loading.
* Move http out of main binarybptato2023-12-138-344/+98
| | | | | | | | | | | | Now it is (technically) no longer mandatory to link to libcurl. Also, Chawan is at last completely protocol and network backend agnostic :) * Implement multipart requests in local CGI * Implement simultaneous download of CGI data * Add REQUEST_HEADERS env var with all headers * cssparser: add a missing check in consumeEscape
* Move gopher to adapter/bptato2023-12-122-154/+0
| | | | Also, move default urimethodmap config to res.
* Move out ftp: protocol; fix some local CGI bugsbptato2023-12-123-217/+15
|
* Move out file: protocol handling to adapter/bptato2023-12-123-129/+2
|
* local CGI improvements, move data: to cgi-binbptato2023-12-124-58/+87
| | | | error codes are WIP, not final yet...
* local CGI: add mapped URI env vars; move about: to adaptersbptato2023-12-123-41/+21
| | | | | | | | | | | | | | | * Add MAPPED_URI_* as environment variables when a request is coming from urimethodmap It costs us compatibility with w3m, but it seems to be a massive improvement over smuggling in the URL as a query string and then writing an ad-hoc parser for every single urimethodmap script. The variables are set for every urimethodmap request, to avoid accidental leaking of global environment variables. * Move about: to adapters (an obvious improvement over the previous solution)
* Separate gopher conversion from main binarybptato2023-12-101-115/+10
| | | | | | | | | | | | | | | | | | | | | Now we use a (much simplified) gopher2html binary in libexec, instead of converting gopher directories to HTML in loader/gopher. This has two advantages: * Less ugly conversion logic in the loader module; we can just convert the file line by line. (The previous converter also had some correctness issues, that is fixed now as well.) * If the user desires, they can replace the gopher converter with another binary using the mailcap mechanism. The disadvantages are: * For now, source display is broken. This is a problem with all mailcap filters in general, and should be fixed in the future. (That said, the previous version also only displayed the converted HTML source, which was not really useful anyway.) * The proper directory structure is required for this to work; OTOH plenty of work has been done so that this is as frictionless as possible, so it should not really be a problem.
* http: use Accept-Encodingbptato2023-11-171-0/+3
| | | | just ask libcurl to decode
* reduce new() usagebptato2023-10-251-10/+10
|
* Remove trailing spacesbptato2023-10-231-1/+1
|
* loader: remove stray eprintbptato2023-10-211-1/+0
|
* loader/http: do not choke on 103 early hints, use copyMembptato2023-10-201-11/+39
|
* dirlist: quote path names in hrefbptato2023-10-181-1/+1
| | | | | | | so that it does not choke on files with an apos in them. (We could also htmlEscape it, but this should be enough since we percent-encode the paths already.)
* XHR progressbptato2023-10-141-1/+39
| | | | still non-functional
* Add w3m-cgi-compat optionbptato2023-10-013-7/+29
|
* Add urimethodmap supportbptato2023-09-302-39/+72
| | | | yay
* loader: add local-cgibptato2023-09-304-16/+198
| | | | | | | | | | | Add w3m-style local CGI support. It is not quite as powerful as w3m's local CGI, because it lacks an equivalent to W3m-control. Not sure if it's worth adding; we certainly shouldn't allow passing JS in headers, but a custom language for headers does not sound like a great idea either... eh, idk. also, TODO add multipart
* Response.text: assume utf-8bptato2023-09-271-5/+5
|
* Response.text: encode/decode properlybptato2023-09-271-2/+16
| | | | also, use blob() for images
* buffer: simplify contentType handlingbptato2023-09-272-5/+5
| | | | | | * remove contentType member of Buffer object * add ishtml to reduce string comparisons * consistent spelling: contenttype -> contentType
* Add about:licensebptato2023-09-231-0/+6
|
* buffer: make clone fork()bptato2023-09-232-8/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes e.g. on-page anchor navigation near-instantaneous. Well, as instantaneous as a fork can be. In any case, it's a lot faster than loading the entire page anew. This involves duplicating open resources (file descriptors, etc.), which is not exactly trivial. For now we have a huge clone() procedure that does an ok-ish job at it, but there remains a lot of room for improvement. e.g. cloning is still broken in some cases: * As noted in the comments, TeeStream'ing the input stream for any buffer is a horrible idea, as readout in the cloned buffer now depends on the original buffer also reading from the stream. (So e.g. if you clone, then kill the old buffer without waiting for the new one to load, the new buffer gets stuck.) * Timeouts/intervals are broken in cloned buffers. The timeout module probably needs a redesign to fix this. * If you clone before connect2, the cloned buffer gets stuck. The previous solution was even worse (i.e. broken in more cases), so this is still an improvement. For example, this fixes some issues with mailcap handling (removes the "set the Content-Type of htmloutput buffers to text/html" hack), does not reload all resources, does not completely break if the buffer is cloned during loading, etc.
* remove unnecessary toTable callsbptato2023-09-204-19/+11
| | | | | | | We did this to please the compiler at one point, but it seems to be fine to remove now. (Also, use withValue when possible.)
* fix compilation on 1.6.14bptato2023-09-204-6/+6
|
* loader: add gopher supportbptato2023-09-203-0/+269
| | | | works
* ftp: add missing prepareMutationbptato2023-09-201-0/+2
|
* ftp, file: better dirlist, fix FTP path issuebptato2023-09-193-35/+130
| | | | | | | | | * Dirlist is now unified across ftp and file loaders. It's basically a copycat of w3m's FTP dirlist, because I like how it looks. * We now hack around the cURL FTP path problem by always prepending a slash to the path. This is probably closer aligned with expectations than the default behavior.
* ftp: encode paths, escape displayed stringsbptato2023-09-191-8/+11
| | | | avoid e.g. # being interpreted as a fragment
* ftp: add auth inputbptato2023-09-191-14/+32
|
* loader: add FTP supportbptato2023-09-196-38/+219
| | | | | | | | | | | | works, sort of still needs some work: * better dirlist, ideally make it look like file dirlist (or make file look like ftp dirlist. well, anyway, they should look the same) * absolute paths? (for now you have to append an extra slash to the path beginning) * ssh keys for sftp? (actually I haven't even tested sftp yet...)
* response: add blob() functionbptato2023-09-171-1/+20
|
* data urls: percent decodebptato2023-09-151-5/+5
|
* move around more modulesbptato2023-09-1410-0/+1311
* ips -> io/ * loader related stuff -> loader/ * tempfile -> extern/ * buffer, forkserver -> server/ * lineedit, window -> display/ * cell -> types/ * opt -> types/