320 points · by jezek2 · 1y ago · 147 comments
At some point I've realized that much of the complexity and resource requirements of web browsers comes from JavaScript. This is because every part needs to be dynamic and optimized for speed.
So a few years ago I've started to work on a web browser that intentionally doesn't implement JavaScript, instead it contains an updated set of scripts that fix and improve various websites.
I've been using this approach using a proxy server for a few years as my primary way of web browsing with good results. It uses a whitelist approach where no resources are loaded from different domains by default (the fix scripts can override it to load images from CDNs, etc.). This avoids any trackers by default.
You can find more details on the homepage of the project:
I'm currently running a fundraiser to get it really going. All the foundation blocks are there it just needs some more work. Any support is welcome.
Now for the nit picking. From the FAQ:
> For example the HTTP code has no implementation of features that can be used for tracking (such as ETags).
True, ETags can be used for precise client tracking (just like a cookie with a unique client ID); but they are also useful for caching resources client-side, thus reducing data usage, server resources, client processing, etc.
Since the browser/backend is already using a whitelist approach, I would like to suggest optional support for ETags for websites that the user decides to trust.
Also, unless FixBrowser/FixProxy becomes relevant enough to show up on the pie chart besides Chrome, Firefox, and Safari, individual users can be easily fingerprinted based on e.g. IP ranges and the mere fact that the client behaves differently. This is an uphill battle, but I'm glad that efforts like this even exist.
They didn't "give up" on Servo. Servo was always intended as a test-bed for Firefox engine technologies. It was just some weird false hope in the OSS community that it would be some new "super browser".
They integrated what they were looking for into Quantum and then the community took the browser portion and forked it off+continued development (albeit, without Mozilla sponsorship).
tracking is buildin into http/browsers, even without JS. Its just no longer on the client, making it harder for 3rd parties to aggregate the information across domains (e.g. google, meta, etc).
e.g. loading images/tracking pixels on hover (css) to track mouse movements
the only way to make tracking impossible is by only allowing pure HTML with a tiny subset of CSS for styling. like a markdown browser.
while thats a valid technology choice, I'm not sure how many ppl would ever use such a thing, it'd be incompatible with the vast majority of websites.
the only one's that come to my mind would be even better as RSS/Atom Feeds, so - from my perspective - it'd have a bigger potential if it just creates these feeds by parsing the websites. But you'd still have to preload them with a browser on a server somewhere for the sites that actually require JS / SPAs without hydration.
And once you're there, youre already in a market with multiple options
What language is it written in?
FixBrowser is written in FixScript. [...] FixScript is a memory safe, thread safe and integer overflow safe language with minimal native surface area, greatly reducing any security problems. Ideal for processing potentially malicious websites.
It is also very portable (only a C compiler is needed), it even has an ability to emulate threads for environments that lack it (eg. WebAssembly - important for mobile support).
> It started as a very simple scripting language for a specific need. But when I caught myself using it also for the main program it became obvious that the language is much more than just for the scripting.
It has some interesting parts; the "base" vs. "classes" syntaxes remind me of Vala. Using syntax to disambiguate some things at compile time reminds me of Raku (including typed variables). It also has syntactic macros (similar to Erlang parse transforms) called "token processors", so the syntax is fully extensible - invalid tokens are kept by the parser and passed to token processor, so in principle you could completely ignore the original syntax (something you can't do in Rust or Nim).
In any case, the language is rather small and simple (it reminds me of Janet a bit); picking it up shouldn't be too big of a hurdle, I think.
Anyway, what I typed there was: I read that you don't support JS intentionally. That's fine and dandy. If I were to create a browser from scratch, I'd probably do that.
However, what I'd really like to see is the ability to plug many scripting engines: Maybe you want to make V8 pluggable, or SpiderMonkey, or let's open the box: plug Python! That might enable the possibility to have a front-end stack that is HTML, CSS and Python (without the JS in the middle).
It would open a whole new spectrum of Web development, one that is not subjugated to the pitfalls of JS.
WebAssembly kind of opened that door, but a native interpreter would be good to have.
P.S.: I'm aware Brython exists, but it feels like a cheat to me.
Python is ill-suited for browser scripting because it boldly claims to have “batteries included”, i.e. it has a sprawling standard library, and most of it is entirely incompatible with the browser environment’s sandboxing and async execution model.
So Python for browser scripting would be a limited subset. And if you go there, what’s really the point of writing programs in an incompatible version of a language whose sole reason to exist is the supposed ease-of-use…
You could also use the AS distros to write classic, pre-.NET ASP applications. I know of at least one startup that actually did this (ActivePerl + classic ASP + IIS on Windows NT/2000), or at least seemed to based on their job postings.
Per a previous comment[0], Python was an example of my point, but I was thinking even more about any scripting language that employs pre-processors so the code inlining works.
> Back in the late 1990s, multi-language support was part of the original design of the <script> tag. Microsoft’s market-leading browser defaulted to VBScript rather than JavaScript.
That in the context of the browser wars back then. Today that war is kind of settled, still fighting to take down some Chrome's dominance of course.
> But of course people wanted interoperability rather than writing separate scripts for IE and Netscape.
But my point is that it would be a kind of start, JS is too dominant for the front-end community. If you don't know JS you're just dead in the water.
You have to inherently like JS to be an effective front-end developer. That's an unfair constraint.
WebAssembly kind of opened that door, but we are still in these early days.
--
And javascript simply downloads its own batteries. "Only on first visit, I swear".
The "guts" of the LHEATcl plugin is a dynamically loadable library (DLL) containing the compiled object files from Tcl/Tk, FitsTcl, POW, etc. Currently, there is just one, monolithic LHEATcl DLL, unlike the LHEA standalone Tcl scripts such as fv where there one DLL for each package (Tcl, Tk, fitsTcl, POW, etc) . This library is placed in your browser's plugins directory. Currently Netscape4.x and Internet Explorer 3.x, 4.x, and 5.0 are supported. Netscape3.x is not supported because the Javascript we use to setup a window to run the tclet in doesn't work in Netscape 3.x. When your browser starts up it scans the plugins directory. If it finds the LHEATcl plugin library, it adds the LHEATcl plugin to its list of plugins and registers the plugin to process files of mime type "application/x-tcl". For details of how this information is stored in the library file, see the documentation for the Netscape plugin SDK. }}
https://heasarc.gsfc.nasa.gov/Tools/maki/plugin/LHEAapi.html
JavaScript is weird, but it was specifically made and has evolved entirely for making non blocking, snappy, event driven user interfaces.
Python was not.
Also, you’d end up breaking the very standards that make the web open. If websites only work on 1 browser because it’s the only one that supports Python, then you’ve just lost the open web.
That’s the whole idea around WASM. A standard compile target that’s designed for the sandboxes environment of websites.
Every browser takes several gigs of ram once you have more than a couple tabs open. I’m in the niche looking to trade off some functionality to gain some efficiency.
A browser which implements unique functionality breaks away from the open web.
Much like PHP does with open and closing tags, in the early days of Web development, I remember doing websites with Dreamweaver that way.
How'd you feel about a client-side PHP subset?
I’m sorry, I’m not really understanding what you mean here.
> client-side PHP subset
I’d dislike it for the same reasons as before.
Php was made to and evolved largely for generating HTML on a server. Not to have snappy, non blocking, event driven user interfaces.
And since PHP is not a standardized the same way JavaScript is, any browser may or may not implement it the same was as another.
We’d be back in the early 2000s world of browsers incompatibilities.
What would native browser support for php give you vs a wasm implementation of it?
The implementation details also affect runtime performance.
JavaScript rarely blocks execution, it’s what makes it snappy.
For example, Python blocks by default, unless you run your inside a Python async wrapper like asyncio.
It uses its own language, it's really written from scratch to such an extent that it uses direct C API for Cocoa on macOS instead of the usual approach of just using a couple of Objective C files. The code is not in a version control, and I have not seen a single comment apart from the copyright headers.
Using of C API for Cocoa is for compatibility reasons, using ObjC API is fully supported by Apple so it's not an hack in any way. Normally the used SDK dictates the minimum version of the OS and it's harder to support multiple versions. With using ObjC API directly any MacOS from 10.6 up can be supported easily.
I've used similar approach for Haiku, it uses C++, this is more hacky but given their strong stance on binary compatibility it is fine and worked well across multiple releases without any changes so it's clearly a valid approach :) The reason is that I had big issues to get a C++ cross-compiler working for Haiku - supporting many platforms is not an easy task when you want to provide prebuilt binaries from a single VM.
As stated in other comment, I'm using Monotone VCS for version control and have other reasons as well.
As for the code comments, generally I don't need them, the code tends to be self-describing. And when I need them it is for describing something intricate which I generally find out later when I need it, at that point I document it because it's clearly needed, but also at that point I know exactly what to document. Better to avoid intricate things though.
On the other hand I should focus more on the architectural documentation that I've partially written but needs to be improved and expanded.
Haiku impressed me so much that even when I'm unlikely to use it as an user (mostly because I have already usable setup that I like), I've found it very good and polished. So I've decided that all my software will get 1st class support for Haiku :)
This is how almost all other languages implement Cocoa support, btw. With a few weird exceptions like Apple's Objective-C++ compiler, most everyone implements FFI by chaining together LanguageA -> C -> LanguageB.
Otherwise you'd have to build an N-to-N matrix of cross-compilers, and it becomes a whole mess.
I suppose my idealism is running hard into reality. Obviously, this project is feasible and does work for many sites (not YouTube or Netflix, due to lack of <video>, but does work for CNN and HN and acoup.blog and...). I want to live in a world where either this is wildly successful and everybody knocks it off, or a world where this is completely impractical because everyone is doing Cool Art Things and this simply would be impractical. But this world where it's practical, but unloved... do not like that.
Instead the community is relied upon to reimplemented the behavior in FixScript which means by necessity only a smaller number of popular sites will load correctly m
It must take courage to disclose your product to HN.
We need to return that courage with an attempt.
First, the evaluation. Then constructive comments.
Regardless, good luck to the project. Would be interesting to see the end result.
To the author - there are certain social (and developer) expectations I would suggest you look into, e.g information about you (considering you are asking for donations; who am I donating to?) and a public repository people contribute code to. King of my own castle approach won’t really work here.
I still think that a publicly viewable version control repository would be a good idea though (there are many advantages to this), even if you do not accept pull requests or other stuff like that. (The version control system does not have to be Git; there are others as well, but it would be good to be well-documented (in my opinion, Fossil has better documentation than Git, anyways).)
Isn't that kind of the whole ethos of free software? The current capitalistic view that open source is a (unpaid) job producing a product seems... unsustainable
Deliberately going against commonly accepted practices—like not providing a public repository—can be counterproductive to the project.
For example, the ‘submit code changes via email’ approach comes across as ‘you can help, but I’ll privately decide if your help is good enough’ which might discourage potential contributors.
That seems pretty much identical to how most of the high-profile open-source projects run.
Ever tried submitting a patch to Android? or even the Linux kernel?
That's literally how opensource works.
Thank you so much for making this project.
I'll be adding it to my test suite.
I wonder if you could apply for some funding from https://nlnet.nl/ ?
It is very useful, I've been using it myself for multiple years with good results.
Having own browser is to reduce the memory requirements further. Even with FixProxy the normal browsers use a lot of memory, sure it's better than normally but still a lot.
With FixBrowser the memory requirements are much lesser and it's much more portable, for example to older systems or computers with weak specifications.
I plan to add an optional support of embedding CEF so that you can use it for specific tabs or websites directly from FixBrowser instead of having to switch to another browser.
In the future there could be a similar support of embedding Ladybird engine.
It could be cool to pair this with a SSR backend and package it into a Electron-like desktop app. You'd get basic UI, but it could be very lightweight. The biggest complaint about electron has long been memory usage. Could work great for kiosks too.
Also, in case helpful, a few typos we caught: https://triplechecker.com/s/493676/fixbrowser.org
> From the development point if there is something that truly requires multiple developers to implement it is most certainly too complex and should be made simpler or a separate project.
[0] - https://old.reddit.com/r/ProgrammingLanguages/comments/zwp51...
As for FixBrowser fortunatelly I'm not working on a full fledged web browser and it has significantly reduced complexity.
You can for example read medium articles just fine with w3m.
Likely the solution was driven by the developer, not the needs of the people wanting that information, or the needs of the business.
I would hazard a guess that the author of the site either only knew one way to make a site, or they wanted to learn how to make a site that way, possibly as a portfolio piece.
I don't see any loss of value there.
I am wondering how much of this is true?
they also probably don't implement most of CSS
FLTK is better then GTK on linux. Since version 1.4 FLTK supports HighDPI displays and Wayland https://www.fltk.org/articles.php?L1947 GTK3/4 and Qt5/6 are bloatware!
$ ls -1 fixgui_\*.c
fixgui_cocoa.c
fixgui_gtk.c
fixgui_haiku.c
fixgui_win32.cFor example if we know large SPA frameworks and/or slow websites require use of convention A then simply not include support for convention A. This is a fail by design approach instead of a blacklist approach.
Here are some things to block to radically increase performance:
* string parsing: innerHTML, querySelectors, console.log
* allow a quota of load time requests and then stop taking http requests until a person interacts with the page (or just break the page). If you set the quota at 10 then any pages with greater numbers of requests will just stop loading. That alone will eliminate 99% of spyware and dramatically shift user behavior.
* drop requests for JavaScript from different origins than the page will improve both performance and privacy
The biggest thing to help with privacy is to not support CORS. That will do more than eliminating JavaScript.
These things are still highly restrictive but much less so than a blacklist approach.
I don't have numbers, but I doubt an in-browser JS implementation without these APIs would be useful on many websites. Even HN uses innerHTML.
I have worked on a web browser. It's fricking hard. Remove JavaScript and DOM entirely, and it gets much easier.
Now if you start to implement select parts of the spec, it becomes even harder when something fails to know whether it's a feature (because you don't like that part of the spec) or a bug (because you misunderstood or misimplemented some part of the spec that you wanted to implement correctly).
Basically, untill proven otherwise the recurring offenders which are the sole benefit of this crime are guilty.
A project based on servo would be more credible. Sure, those developers are building JavaScript engines. However, their browsers are highly modular and you could do a build without JavaScript, a lot more easily than with the major browser engines.
In addition, it uses your own programming language, and there is no source repo.
Edit: I see the purpose of it better now. It would perform very well, but not compared to other browsers that had the same modifications. However, since other browsers don't have the same modifications, it would work comparatively well for the sites it would work with.
If you wanted to make it run fast with while supporting a lot of sites, and still be simple, I think using Servo would be a quicker path. They've already solved a lot of layout problems.
Good luck with it.
It allows for a much simpler one-way processing from one stage to another. In comparison a full browser must maintain data structures for fast dynamic changes by JS, making it much more complex. I've written about it in a more detail in the About section.
Embedding of a full browser engine as an option is planned, I've chosen CEF as the most suitable choice. It could be used for specific tabs or websites (eg. applications) while being integrated with the rest of the browser. However CEF is not very portable so it won't be available for all planned systems.
This way you would use it only for websites/applications that need it while saving resources when browsing the rest of the websites.
However, they do provide a zip file containing source.
At least it’s open source although for some reason they are choosing to not use a version control system.
- A source code version control repository (using any source code repository service, or hosting your own) should be made available, e.g. in case you want to view only some of the files.
- I think that all of the scripts for fixing/improving web sites should be implemented as extensions (and allow the user to disable and change the settings (e.g. where to apply them to) of any of them), and that you can use C as well as FixScript, that you can load native code files.
- Some programs are used on multiple web sites; it should be able to identify the program in order to apply the scripts to any web site that uses that program.
- It should allow to disable CSS (if it does not already do), and the ability to disable specific features of CSS (e.g. transitions, fonts, etc). The ability for a user to apply custom CSS might also do, and if so then it might support some features that are not allowed in web pages.
- It must allow to disable automatic updates (if they are implemented at all).
- It is OK if you deliberately do not want to implement JavaScripts. If JavaScripts are ever implemented though, it must include the ability to disable JavaScripts and the ability to override any functions of JavaScripts and should include the ability to use JavaScripts to make extensions.
- Video playback support is probably not that important, since you can use external programs to play videos.
- If CEF is implemented, it should probably be made possible to compile the program without that feature in case you do not want it (in order to avoid adding dependencies that you will not use).
- I would also be interested in being able to add extensions for implementing URI schemes and file formats, and also would be interested in proper support for non-Unicode text.
- The ability to use unencrypted proxies even for encrypted connections would be helpful, in case you want to use your own proxy without needing to decrypt/encrypt the data twice.
- I have no debit/credit card, and I have no European money.
I've been using this approach for the last few years with good results. Only few websites (typically web applications) I need to open in a regular browser otherwise majority of my browsing works without JS just fine (thanks to the fix scripts).
I get the idealism, sentiment, and nostalgia. But the web has always been a mediocre platform, a straight jacket, a bit of a terribly disgraceful kludge. Fixing it by crippling it further doesn't make it better.
The good news is that there are other ways forward. I like what's happening with WASM. WASM fixes browsers to be suitable for running any kind of code. There are some silly examples out there of browsers running emulators with legacy operating systems running a 25 year old browser. Or stuff like winamp. But the main point is that we're no longer restricted to using javascript/css/html. We can now use pretty much any language, any framework, any kind of rendering engine. Browsers can now run hardware accelerated 3D graphics.
Browsers as a virtualization platform are rapidly catching up with Sun's vision of thin client computing a quarter century ago. And just around the same time that the web is rapidly expanding across devices and modalities. Mobile, AR/XR/VR, entertainment consoles, etc.
Browsers are backwards in the sense that they started with a very limited/crippled platform that was then extended slowly and haphazardly over the course of nearly 35 years with enough technology that you can run pretty much anything inside them now.
A more logical architecture would be to start with a minimal VM that is powerful enough to run anything you'd want to run and then run all the rest inside (including legacy crap like CSS/HTML/JS, Flash and all the rest.). Sun had some of the right ideas but got hung up on the wrong technologies.
With it you can use it to browse most websites. And these that don't work you can open it in a regular browser. There is even a plan to have integration of CEF (Chromium Embedded Framework) that allows to use the full browser experience for a specific tab or website directly from FixBrowser.
I've been using this approach for the last few years with good results.
Anyway, that's why I've come up with the fix scripts that can make websites work with JS disabled. It can fix problems and even improve the usability of various websites.
I've been using this approach succesfully for a few years already with good results. So there is no reason to just abandon the idea when it's proven to work.