about summary refs log tree commit diff stats
path: root/src/bindings
Commit message (Collapse)AuthorAgeFilesLines
* quickjs: reduce diff with upstreambptato2024-03-021-10/+4
| | | | | | * the uint8array thing is probably from txiki.js, but we never used it * upstream now has JS_GetClassID, importing that instead... (so this commit won't build :/)
* libregexp: cast flags to the right sizebptato2024-02-181-1/+1
| | | | We have less than 8 flags, so the set's size is 1.
* regex: re-work compileSearchRegexbptato2024-02-171-7/+16
| | | | | | | I've gotten tired of not being able to search for forward slashes. Now it works like in vim, and you can also set default ignore case in the config.
* js: define toStringTag properlybptato2024-01-241-0/+1
|
* js: small improvementsbptato2024-01-171-1/+1
| | | | | * turn JSFuncGenerator into a ref object (it's faster this way) * remove strformat dependency
* js: use Nim allocatorbptato2024-01-081-16/+30
|
* Use std/* imports everywherebptato2024-01-071-1/+1
|
* Fix some casing issuesbptato2024-01-061-1/+1
|
* Compile with styleCheck:usagesbptato2023-12-284-9/+9
| | | | much better
* dom: use JS_EvalFunction; add module fetching stubsbptato2023-12-251-0/+1
| | | | (still no module support in buffer...)
* bindings/quickjs: cint -> csize_tbptato2023-12-231-1/+2
| | | | | | cint was incorrect :/ Makes me wonder if maybe we should just use futhark after all...
* ftp: fix unnecessary slashes being added to path; move bindings/curlbptato2023-12-151-425/+0
| | | | also in ftp: clean up resources before exit
* http: use CURLU for URLsbptato2023-12-131-0/+78
|
* Move http out of main binarybptato2023-12-131-0/+3
| | | | | | | | | | | | 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
* pager, container: add text selection/copyingbptato2023-12-031-0/+2
| | | | | | | | | | * Add select & copy selection functionality to container * Fix bug in generateSwapOutput where output could be misplaced because of zero-width cells * Add fromJSPromise, call runJSJobs in every iteration of the headed event loop * "await" pager actions that output a promise * Change default view source keybinding to `\'
* Get rid of clang 16 workaroundbptato2023-12-022-5/+20
| | | | | * bindings/quickjs: importc and use correct pointer types * add constcharp module for when it is unavoidable
* js: get rid of getJSValuebptato2023-12-021-1/+2
| | | | just use an UncheckedArray in the binding
* js: simplify toJSP0bptato2023-11-301-2/+6
| | | | | | | * Expose js_create_from_ctor from QuickJS and directly use that (instead of badly recreating it) * Do not call defineUnforgeable twice (it is inevitably called in toJSP0, so jsctor does not need it)
* bindings: find termcap on FreeBSDbptato2023-11-211-2/+13
| | | | | pkg-config does not find termcap (or really, ncurses) here, so we have to find it ourselves.
* http: use Accept-Encodingbptato2023-11-171-0/+1
| | | | just ask libcurl to decode
* Add jspropnames, CSSStyleDeclaration stubbptato2023-10-251-1/+5
|
* Remove trailing spacesbptato2023-10-232-85/+85
|
* base64: reduce pointless re-coding using JSStringbptato2023-10-211-0/+11
| | | | | We now expose some functions from QuickJS to interact with JavaScript strings without re-encoding them into UTF-8.
* javascript: add TextEncoder, TextDecoderbptato2023-10-211-0/+11
|
* ftp, file: better dirlist, fix FTP path issuebptato2023-09-191-1/+1
| | | | | | | | | * 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.
* dom: add document.all, misc fixesbptato2023-09-191-0/+1
| | | | | | | | * Fix an issue with Collection cache invalidation (we must invalidate collections of the parent node on insertion, so that it triggers a refresh). * Remove circular reference of document.document, now we use a function instead.
* loader: add FTP supportbptato2023-09-191-0/+8
| | | | | | | | | | | | 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...)
* bindings: fix JSInterruptHandler signaturebptato2023-09-151-1/+1
|
* Allow overriding libcurl namebptato2023-08-261-3/+9
| | | | for better compatibility with curl-impersonate
* javascript: misc. refactoringsbptato2023-08-241-1/+3
| | | | | | | | | | | | * Remove some unused properties from objects * Un-extern JSFunctionList * Remove js/javascript dependency from regex (the wrapper functions were rather pointless) * Remove setProperty (only toJS(Table) used it, but there we have to use defineProperty instead.) * Accordingly, use definePropertyCWE in toJS(Table) * Simplify fromJSTable (replace pointer arithmetic with UncheckedArray) * Reduce implicit `result' usage
* javascript: finish LegacyUnforgeable + misc fixesbptato2023-08-201-0/+11
| | | | | | | | Add jsuffget, jsuffunc for setting LegacyUnforgeable on functions. Misc fixes: * define LegacyUnforgeable properties for native object shims * replace some macros with templates
* javascript: update Events, misc fixes & additionsbptato2023-08-201-3/+15
| | | | | | | | | | | | | | Events: just implement the interfaces, no events are triggered yet. JS changes: * add LegacyUnforgeable * make consts enumerable * fix crash in isInstanceOf * fix destructor warnings * refactor registerType As a result, peakmem is now 1G+ on 1.6.14. It stays ~750M on 2.0.0. Hmm. Well, better upgrade to 2.0.0 I guess.
* Fixes & workarounds to compile on Nim 2.0.0bptato2023-08-012-1/+4
| | | | | | | | | | | | | | * Import punycode, as it has been removed from stdlib. * Fix some syntax errors * Apparently you can no longer compare distinct pointers with nil. Add explicit comparisons with typeof(nil) instead. * htmlparser: rename _ to other, as semantics of _ have changed. (Quite a shame, it looked better with _. Oh well.) * Explicitly specify mm:refc, as the browser OOMs with orc for some reason. Confirmed to compile & run on 2.0.0, 1.6.14, 1.6.12, 1.6.10 and 1.6.8. (<1.6.8 it's broken & wontfix.)
* Include libunicode header in bindingbptato2023-07-151-0/+5
|
* Add libregexp header to libregexp bindingbptato2023-07-042-15/+12
|
* Fix CastSize warningsbptato2023-07-031-2/+2
| | | | Introduced by 1.6.14. Warns of undefined behavior.
* Remove getClassID hackbptato2023-06-271-0/+1
| | | | Add a JS_GetClassID function to QJS instead.
* Working Nim-QuickJS GC integrationbptato2023-06-241-0/+2
| | | | I believe this works correctly. Hopefully I'm not wrong.
* Fix module loading bugsbptato2023-06-221-0/+2
|
* Include QuickJS sources in the repositorybptato2023-06-221-17/+2
| | | | Taken from txiki.js, so it includes zamofex's top-level await patch.
* Rework JS exception systembptato2023-06-191-0/+11
| | | | | Now we use Result for passing exceptions to JS. As a result, we can finally get rid of the .jserr pragma.
* Simplify request.json, remove unused bindingsbptato2023-06-092-68/+3
|
* Show error messages, fix some fetch crashesbptato2023-06-091-0/+1
|
* Add support for canvas and multipartbptato2023-06-052-1/+80
| | | | | | | | | | | | | | | Quite incomplete canvas implementation. Crucially, the layout engine can't do much with whatever is drawn because it doesn't support images yet. I've re-introduced multipart as well, with the FormData API. For the append function I've also introduced a hack to the JS binding generator that allows requesting the JSContext pointer in nim procs. Really I should just fix the union generator thing and add support for overloading. In conclusion, for now the only thing canvas can be used for is exporting it as PNG and uploading it somewhere. Also, we now have PNG encoding and decoding too. (Now if only we had sixels as well...)
* Add module loading to clientbptato2023-06-011-0/+3
| | | | Files only, for now.
* Some bindingsbptato2023-05-241-1/+10
|
* Merge branch 'wip_fetch'bptato2023-04-301-0/+5
|\
| * WIP fetchbptato2023-04-301-0/+5
| |
* | Add initial proxy supportbptato2023-04-301-0/+1
|/ | | | For now, API-only.
* Loader: use curl_multibptato2023-04-281-1/+61
| | | | | Note: for now it's only used for http requests. The doRequest API still needs an async rework.