| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Until recently, glibc used to implement it as fstatat. So don't trap
for fstatat (and for consistency, fstat), but return EPERM.
Just to be sure, rewrite sixel & stbi to never call fread.
|
|
|
|
| |
unused
|
|
|
|
|
|
|
|
| |
If TERM is unrecognized by termcap, retry as dosansi.
When that fails, just fall back to the non-termcap code path.
(There is no reason to panic without termcap; it's just one of the
several capability detection mechanisms we use.)
|
|
|
|
| |
Operation "modularize Chawan somewhat" part 3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a minefield.
Intuitively, you would think that just clearing the opaque and manually
freeing registered object should be enough. Unfortunately, this is
not true; we do not store whether we are actually holding a reference to
registered JS objects, so this approach leads to double frees.
Instead, we add a QJS callback that is called right after the final
GC cleanup, but before the list_free assertion. This way, we can be sure
that any object still in our registry is referenced by us, and can
therefore unreference them safely.
|
|
|
|
|
|
|
|
| |
TODO: find the exact flags we need instead of -fpermissive.
See also:
https://todo.sr.ht/~bptato/chawan/12
https://forum.nim-lang.org/t/11587
|
|
|
|
|
|
| |
Use a LUContext to only load required CharRanges once per pager.
Also, add kana & hangul vi word break categories for convenience.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of using the built-in (and outdated, and buggy) tables, we now
use libunicode from QJS. This shaves some bytes off the executable,
though far less than I had imagined it would.
Also, a surprising effect of this change: because libunicode's tables
aren't glitched out, kanji properly gets classified as alpha. I found
this greatly annoying because `w' in Japanese text would now jump
through whole sentences. As a band-aid solution I added an extra
Han category, but I wish we had a more robust solution that could
differentiate between *all* scripts.
TODO: I suspect that separately loading the tables for every rune in
breaksViWordCat is rather inefficient. Using some context object (at
least per operation) would probably be beneficial.
|
|
|
|
|
|
|
| |
* unwind the QJS stack with an uncatchable exception when quit is called
* clean up JS references in JSRuntime free even when the Nim
counterparts are still alive
* simplify some tests
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We use libseccomp, which is now a semi-mandatory dependency on Linux.
(You can still build without it, but only if you pass a scary long flag
to make.)
For this to work I had to disable getTimezoneOffset, which would
otherwise call localtime_r which in turn reads in some files from
/usr/share/zoneinfo. To allow this we would have to give unrestricted
openat(2) access to buffer processes, which is unacceptable.
(Giving websites access to the local timezone is a fingerprinting vector
so if this ever gets fixed then it should be an opt-in config setting.)
This patch also includes misc fixes to buffer cloning, and fixes the
LIBEXECDIR override in the makefile so that it is actually useful.
|
|
|
|
|
|
| |
* separate params with ; (semicolon) instead of , (colon)
* reduce screaming snake case use
* wrap long lines
|
|
|
|
|
|
|
|
|
|
|
|
| |
pledge is a bit more fine-grained than Capsicum's capability mode,
so the buffer & http ("network") sandboxes are now split up into
two parts.
I applied the same hack as in FreeBSD for overriding the buffer
selector kqueue, because a) I didn't want to request sysctl promise
b) I'm not sure if it would even work and c) if it breaks on OpenBSD,
then it's broken on FreeBSD too, so there's a greater chance of
discovering the bug.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's the sandboxing system of FreeBSD. Quite pleasant to work with.
(Just trying to figure out the basics with this one before tackling the
abomination that is seccomp.)
Indeed, the only non-trivial part was getting newSelector to work with
Capsicum. Long story short it doesn't, so we use an ugly pointer cast +
assignment. But even that is stdlib's "fault", not Capsicum's.
This also gets rid of that ugly SocketPath global.
|
|
|
|
| |
upstream now calls it unicode
|
|
|
|
|
|
| |
* 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 :/)
|
|
|
|
| |
We have less than 8 flags, so the set's size is 1.
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
* turn JSFuncGenerator into a ref object (it's faster this way)
* remove strformat dependency
|
| |
|
| |
|
| |
|
|
|
|
| |
much better
|
|
|
|
| |
(still no module support in buffer...)
|
|
|
|
|
|
| |
cint was incorrect :/
Makes me wonder if maybe we should just use futhark after all...
|
|
|
|
| |
also in ftp: clean up resources before exit
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
* 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 `\'
|
|
|
|
|
| |
* bindings/quickjs: importc and use correct pointer types
* add constcharp module for when it is unavoidable
|
|
|
|
| |
just use an UncheckedArray in the binding
|
|
|
|
|
|
|
| |
* 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)
|
|
|
|
|
| |
pkg-config does not find termcap (or really, ncurses) here, so we
have to find it ourselves.
|
|
|
|
| |
just ask libcurl to decode
|
| |
|
| |
|
|
|
|
|
| |
We now expose some functions from QuickJS to interact with JavaScript
strings without re-encoding them into UTF-8.
|
| |
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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...)
|
| |
|
|
|
|
| |
for better compatibility with curl-impersonate
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
| |
Add jsuffget, jsuffunc for setting LegacyUnforgeable on functions.
Misc fixes:
* define LegacyUnforgeable properties for native object shims
* replace some macros with templates
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.)
|
| |
|