
NetSurf, a multi-platform web browser - butz
https://www.netsurf-browser.org/
======
jraph
I find NetSurf's source code beautiful and quite easy to read and follow, and
straightforward. I am impressed. It's like the pure version of "makes sense".
It's also split into independent libraries that can be used outside of
NetSurf, which make them useful on their own, and NetSurf very modular. If I
had to implement something that requires a feature implemented in a browser,
I'd seriously consider one of them. Especially their CSS parser and engine.

I really recommand to have a look at the code.

~~~
userbinator
To be honest, I wouldn't exactly call this "beautiful"...

[https://source.netsurf-
browser.org/libdom.git/tree/src/core/...](https://source.netsurf-
browser.org/libdom.git/tree/src/core/document.c#n117)

[https://source.netsurf-
browser.org/libdom.git/tree/src/core/...](https://source.netsurf-
browser.org/libdom.git/tree/src/core/implementation.c#n62)

[https://source.netsurf-
browser.org/libcss.git/tree/src/parse...](https://source.netsurf-
browser.org/libcss.git/tree/src/parse/parse.c#n416)

Looks like the authors have a severe case of goto-phobia that causes a
quadratic explosion of copy-pasted code in the error-return paths. Some of the
files also feel like they have been translated into C from C++ or some other
OO language by some automated tool, resulting in some very long
"namespaced"-looking identifiers.

Then again, I don't think Firefox or WebKit code is that much better either,
so my impression of this codebase is neither great nor horrible. As
"beautiful" is subjective, to give a reference for what I'd consider
beautiful, look at BSD or early UNIX.

~~~
Hello71
there are other "C++ programmer trying to write C" anti-patterns, such as
typedefed structs and one "class" per file, leading to terrible performance
without LTO. stuff like [https://source.netsurf-
browser.org/libdom.git/tree/src/core/...](https://source.netsurf-
browser.org/libdom.git/tree/src/core/cdatasection.c) has more signs of
excessive C++ love: "vtable", "protected", etc. I don't know that these things
are inherently bad, but they certainly don't exist in C.

~~~
userbinator
...and despite that, it still manages to feel faster than the mainstream
browsers, which says just how much extra overhead _those_ have, and that there
is still "more room at the bottom" to trim this one down some more too.

------
james412
I was able to download and build the Gtk3 version of this in under 5 minutes.
For compactness alone, gets my seal of approval. I'm posting this comment from
NetSurf, HN works fine.

~~~
unicornporn
Does it block ads?

Asking because: DNS-level adblocking is stupid.

~~~
CyberDildonics
DNS level adblocking is fantastic, especially since it can be done network
wide so easily and used as an extra layer of ad filtering.

~~~
vageli
> DNS level adblocking is fantastic, especially since it can be done network
> wide so easily and used as an extra layer of ad filtering.

It's great, but DNS over HTTPS will end the party soon enough (if I was a
smart TV manufacturer, I would be prioritizing adding dns over https to the
device firmware to subvert network blocks).

~~~
Arnavion
DNS-adblocking in a router can be complemented by the router's firewall
blocking outbound to all DoH provider IPs.

(It'll need to be a constantly-updating blocklist, but the DNS-adblock lists
are also that already.)

~~~
0xcde4c3db
I can't vouch for these since I haven't tried them yet, but it can apparently
also be complemented by configuring your local DNS server to return NXDOMAIN
for use-application-dns.net [1] and using a DoH proxy to protect upstream
requests from snooping [2].

[1] [https://support.mozilla.org/en-US/kb/canary-domain-use-
appli...](https://support.mozilla.org/en-US/kb/canary-domain-use-application-
dnsnet)

[2]
[https://github.com/aarond10/https_dns_proxy](https://github.com/aarond10/https_dns_proxy)

------
buzzert
If anyone here is running Linux and is now researching a "backup plan" in case
Firefox pivots, I would highly recommend Epiphany (now called GNOME Web):
[https://wiki.gnome.org/Apps/Web](https://wiki.gnome.org/Apps/Web)

~~~
dependenttypes
There are also surf [https://surf.suckless.org/](https://surf.suckless.org/)
and qutebrowser [https://qutebrowser.org/](https://qutebrowser.org/), both
based on webkit.

~~~
imiric
I use my own fork of surf daily, but am having to fallback to mainstream
browsers quite often these days as sites stop working on it or it's unusably
slow. Slack no longer works, GitHub breaks occasionally, etc.

Is there a well-maintained fork that fixes these issues? The main repo[1]
hasn't seen updates in over a year now. I read that development slowed down
after the main maintainer left suckless, but I'm hoping the community will
pick it up. It's an excellent minimal browser.

[1]: [https://git.suckless.org/surf/](https://git.suckless.org/surf/)

~~~
The-Compiler
FWIW Slack seems to work fine in surf for me. Are you sure you have an up-to-
date WebKitGTK on your system? Those kinds of issues are typically fixed
there, and not in surf itself. As long as the WebKit API stays backwards-
compatible, there's probably not much need for surf to change (other than for
new features).

There's zsurf based on QtWebEngine/Chromium too, FWIW:
[https://github.com/SteveDeFacto/zsurf](https://github.com/SteveDeFacto/zsurf)

------
userbinator
I remember looking at this and Dillo a while ago, and while it definitely
looked more polished than Dillo, I recall downloading the Windows binary and
it crashing the first time I ran it - not a good start. On the other hand,
Dillo ran immediately and was at least usable. Maybe it's time to try it
again, especially now that there are even fewer independent browsers...

~~~
livre
The Windows binary doesn't crash anymore, I have it installed and use it
occasionally. I also use it on my very low end Linux laptop and it works
wonderfully for anything that doesn't require JavaScript.

Edit: just a warning, the Windows version has problems with the <select>
element, it won't display the options when you click it.

~~~
pixxel
You have discovered websites that don’t demand JS! Seriously though I have JS
disabled (FireFox ext. to turn back on per site) and the amount of broken or
blank pages is saddening.

~~~
anoncake
What's even sadder is that even with all that breakage, disabling JS makes the
web more usable/bearable.

------
thom
Also might be of interest that this can be run in a framebuffer. Sometimes I
work in a virtual console to avoid distractions but when Emacs’ built in web
browser doesn’t serve a purpose, I’ll open NetSurf in another console, and
it’s fine for almost all “search for errors or docs” workflows.

------
dang
If curious see also

2018
[https://news.ycombinator.com/item?id=18692837](https://news.ycombinator.com/item?id=18692837)

2015
[https://news.ycombinator.com/item?id=10417807](https://news.ycombinator.com/item?id=10417807)

2010
[https://news.ycombinator.com/item?id=1913332](https://news.ycombinator.com/item?id=1913332)

------
thrownaway954
ok... i'll bite... how does this compare to chrome in terms of rendering and
compatibility? i don't see this thing listed on caniuse.com.

~~~
sprash
It does not even pass the ACID2 test. It is however the best independently
developed browser engine out there. If you want an alternative to Webkit and
whatever Firefox uses, Netsurf is the only viable option at the moment.

~~~
ori_b
Basically, it's the only browser out there even trying to handle modern sites
that's not mostly funded by Google or Apple (Firefox revenue is mostly coming
from Google, and there's Safari), and which runs on rarer platforms.

It's still relatively big, because web standards are incredibly complicated,
but it's almost tractable.

If you care about browser diversity, it's important.

~~~
mappu
There are a few others but all with their own caveats -

[https://www.ekioh.com/flow-browser/](https://www.ekioh.com/flow-browser/) is
fully independent and can run Gmail, but it's commercial / non-FOSS. It's
funded by contracts in the set-top-box industry.

[https://sciter.com/](https://sciter.com/) is non-FOSS with a free edition but
you shouldn't run untrusted javascript on it

And there are some lightly-maintained forks of the leaked Presto 12.x engine
from before Opera became a Chromium derivative, but of course it's copyright
infringement.

~~~
monocasa
I would love if Opera open sourced Presto. It's unfortunate that the lack of
resources that pushed them to Chromium probably translate to a lack of
resources needed to open source Presto properly, so I doubt we'll ever see it.
: \

~~~
ralls_ebfe
I loved presto so much, not going open source is a huge loss. And now the
future of servo is unclear as well. :(

------
interfixus
So obviously caters to what the web once was and should have stayed, not to
the metastasizing idiocy it has become.

I'm ancient enough to remember when mainstream browsers came in packages of a
few megabytes and got us through the day just fine with a featureset less than
(or at the very most equal to) the current state of NetSurf. In a somewhat
more rational world there would be massive popular pressure for this to remain
the case.

Yes, sites break in NetSurf. This is squarely their own fault for not
providing civilized degradation. Although it certainly wouldn't go amiss if
the NetSurf engine encorporated the worthwhile elements of CSS 3, basically
meaning Grid and possibly Flexbox.

~~~
nyanpasu64
Not sure when CSS variables were added, but I'd consider them more friendly to
user customization than preprocessors that inline the same font stack 20 times
in autogenerated class names (looking at medium.com), requiring you to
override the font stack 20 times.

~~~
interfixus
Granted. Lack of variables was always among the more serious defects of the
confusion that is CSS.

------
forgotmypw17
netsurf is a great browser, i test with it regularly, and it,s a pleasure to
both use and develop for.

------
zzo38computer
It is many good idea, but should need a better customization, and perhaps
better keyboard commands, Xaw widgets, bitmap fonts, etc. Support specifying
pipes and stuff for files like Heirloom-mailx does. What we need is the
browser that you have enough ropes to hang yourself and also a few more just
in case, and NetSurf may be the one to base it from. Make it for the user
first; assume any file received is potentially hostile (whether or not the
connection is secure; a secure connection merely prevents spies from tampering
with it, it does not prevent the server operator from tampering with it!).
Support specifying scripts that the user can replace with their own
implementaiton; this would ensure that the user can alter any document
received, and would even make it more efficient too since the user's
implementation need not be written in an interpreted programming language and
need not be sandboxed as much either.

------
mouldysammich
I've played around with NetSurf a little for fun recently. It performed
surprisingly well on a few of the sites i use. old.reddit, hackernews both
rendered ok with some issues, also miniflux which i use for rss reading worked
well too.

I think its a very cool and admirable project

------
ajxs
I've been using NetSurf for a long time now on my Thinkpad when I'm traveling.
If I only need to check webmail and read articles NetSurf suffices perfectly,
without draining as much battery power as a regular browser.

------
shock
Is there any browser that implements container tabs à la Firefox?

------
dddbbb
I noticed that in the screenshots section[1], the Linux screenshots for the
Netsurf site and Wikipedia are from this year, but the BBC one is from 2011.
How does the current BBC site fare?

[1] -- [https://www.netsurf-
browser.org/about/screenshots/](https://www.netsurf-
browser.org/about/screenshots/)

~~~
ddevault
Front page: [https://l.sr.ht/RfrR.png](https://l.sr.ht/RfrR.png)

Reading an article: [https://l.sr.ht/ZSwt.png](https://l.sr.ht/ZSwt.png)

------
Klonoar
For all that this browser lacks, I think it's simple enough to build that it's
been the "first" browser on a few alternative/hobby OS's, no?

e.g, Redox, maybe Haiku pre-WebKit port? Haiku I could easily be
misremembering as there was probably a BeOS browser that ran, albeit
outdated...

tl;dr I appreciate the simplicity of it in contrast to modern browsers.

------
fouric
Is the NetSurf rendering engine multi-core/multi-thread? It's not clear from
the homepage, which makes me think that it's single-core only.

------
steveharman
Do some pages on the website need a little love for the copyright date?

"Copyright 2003 - 2009 The NetSurf Developers". (eg; Downloads)

------
anthk
Netsurf was a bit unstable and prone to lock compared to Dillo or Links+.

Also, the duktape JS capabilities are behind even edbrowse.

------
unixhero
I wonder if it would build to MSDOS

~~~
Jaruzel
Not a silly question. However, (at a guess) I reckon a lot of the underlying
net code is probably POSIX based, which MS-DOS is not.

I notice there's a framebuffer version, so building a nano-linux distro that
boots instantly into that shouldn't be that hard.

~~~
unixhero
So there's the framebuffer code that's needed and then it's netcode.

So for the framebuffer code, maybe an MSDOS UNIVBE wrapper could be used.

For netcode, I have no idea, but a wrapper for POSIX calls must surely exist
there also.

Anyyways. I guess the userbase would be pretty much nil, for this as
alternatives do exist on DOS :)

~~~
iforgotpassword
For networking on msdos I recommend mTCP. Although it's C++.

The biggest problem however will be compiling the code. The only viable
compiler for msdos is openwatcom so the question is if the code uses any fancy
extensions or gnuisms. Also the only version of openwatcom that didn't produce
broken binaries is the Windows version (or at least was about two years ago).

Happy porting :-)

------
tomphoolery
what in the 1993 is this

~~~
jeppesen-io
no kidding - looks like even the web server is old too. Seems to be Cherokee,
a project which last stable release was 6 years ago

~~~
bandrami
> Cherokee, a project which last stable release was 6 years ago

Its last CVE was 10 years ago[1].

It's not actually necessary for software to change if it already does what you
want it to.

1: [https://www.cvedetails.com/vulnerability-
list/vendor_id-1005...](https://www.cvedetails.com/vulnerability-
list/vendor_id-1005/Cherokee.html)

~~~
actionowl
There's quite a few more recent CVEs for Cherokee.

[https://nvd.nist.gov/vuln/search/results?form_type=Basic&res...](https://nvd.nist.gov/vuln/search/results?form_type=Basic&results_type=overview&query=cherokee&search_type=all)

------
paulie_a
Wasn't that the name of some shitty product from the 90s?

