How Much Smaller Could Web Browers Be?
geoff lane asks: "Netscape, Mozilla and IE are all large programs capable of many functions which are mostly unused (Mozilla does attempt to shrink its runtime size by using DLLs.) Lynx, Chimera and a number of other browsers are smaller but with significantly fewer functions. A modern browser needs to support Javascript, Java and SSL. It doesn't need to support News, Gopher, FTP or e-mail - all of which have perfectly good applications available already (though there should be a way for the Web browser to sub-contract work to these applications). On occasion I've wondered if I could build a halfway decent Web browser from a few specialist program components (for the display and parsing of HTML mostly) and wget, tied together with shell script or Perl and using external programs for most of the necessary support functions. How small can a usable Web browser get? (assuming we define usable as meaning capable of displaying a Slashdot page reasonably correctly *grin!*)"
- A.P.
--
* CmdrTaco is an idiot.
"Remember when the U.S. had a drug problem, and then we declared a War On Drugs, and now you can't buy drugs anymore?"
First, you need a solid list of what features you really want in your web browser. In theory, you could then use Mozilla and compile out all the ones you don't really want. In theory, you could use the fully-featured Mozilla with some extra code to log which features you use, then use that to only compile in what you want. In practice you can only cut out some of the major chunks like mail and news.
So my take on what you need:
* HTTP and FTP support
* HTML rendering, including frames, tables, GIF, and JPG
* Forms support
* SSL support
* Cookies
* JavaScript
You probably also would find useful:
* Support for plugins (Flash and such)
* Support for Java, probably using an external JVM
Luxury items:
* CSS (Cascading Style Sheets)
Note that unlike others, I consider FTP to be critical. I use it all the time from sites that use HTML indices for downloading software, such as Freshmeat.
11.0010010000111111011010101000100010000101101000
You're joking right?
.xls file available internally for the execs? Trivial with Windows Scripting Host and OLE Automation.
1) OLE predates OpenDoc. OLE existed way back on Windows 3.1. The earliest reference I can find right now is a DDJ article on OLE *2.0* written in 1994. The earliest reference to OpenDoc I can find is a press release in late '95 for the OpenDoc for MacOS SDK.
2) OLE is *extremely* widely used. Anyone using Internet Explorer on Windows, or Office on Mac or Windows is using OLE. Anyone using Windows Scripting Host is using OLE. ActiveX? That's OLE too.
3) OLE Automation is *very very handy*. I've had a number of occasions where I've had conceptually simple tasks that were annoying to do in Perl or other Unix-ish methods, but a little OLE-automation of Office and the task is done. Need to parse a bunch of e-mails from my normal POP3 account (no mbox/maildir access), and update an Excel spreadsheet with the new data plus update the charts to include the new data? Need to publish that Excel spreadsheet and charts as a web page on the Extranet for the investors to use, and make the
-JF
MrJoy.com -- Because coding is FUN!
no no no NO!
Sorry, but not Slashdot. Slashdot produces the most disgusting, broken, brain-dead, horrible HTML imaginable. It's nearly as bad as things produced with FrontPage. As long as soi-disant Web designers can rely on browsers tolerating their incompetence, we'll have incompetent Web designers. What we need is a browser which, when fed crud, throws an exception. This may sound extreme but it's the only way we can get a half-decent Web.
I'm old enough to remember when discussions on Slashdot were well informed.
I've been waiting for this moment to unveil my newest creation: the Smallest Browser Ever.
Here is the source:
cut here
----
#!/bin/sh
wget $1
----
The Java virtual machine still needs fleshing out a bit, any help appreciated.
While this isn't the strongest Mac site on the internet, a browser named iCab exists for the Mac. It is around 1.4MB in size (it uses 4MB of RAM however), and it supports HTML, XHTML, Java, (basic Javascript support...still in beta) and all sorts of cool features like ad banner blocking and cool stuff like that.
Doh!
A: It doesn't. Almost every..scratch that. Every decent OS out there, and even some of the not-so-decent ones support Java. So why not put hooks in your web-browser to use your OS's jvm? Of course you'd have to do a little security checking, so the applet coudln't create, rename, move or alter files, and coudln't call other programs. But other than that, isn't that the best way to get java into a browser? Not have it there at all.
You are only young once, but you can stay immature indefinitely.
How Much Smaller Could Web Browers Be?
What next? Brwr?
--
(if you're still looking for the point, it was back there, in the post. </sig>)
The biggest thing on your list will be the Java support. A Java VM will make your browser quite large as a download, if you have to include the VM in your distribution.
.jar file, plus get it executing reasonably fast if you get the right JVM to run it. Better yet - I'm pretty sure that decent garbage collection would help you out a lot, plus thread support which makes for easy multiple connections.
I guess one way around that would be to actually code the browser in Java, and to distribute the JVM separately. One advantage to all of this could be the ease of updating/replacing component classes, or on-the-fly loading and executing of classes. I'm impressed with Java's capabilities in that way.
What I am confused about is Sun's decision to cancel their development of the HotJava web browser. I thought it was quite good. Sure, it had its share of bugs, but it rendered Slashdot ok and it had SSL support. Its performance could have been a bit better (downloading ok - rendering a bit slow), but I bet that simply replacing the JVM with IBM's version would have helped that somewhat.
In any case, if you need Java, then I'd suggest you do the entire thing in Java. I'm pretty sure that you can get your code tightly packed in a
All of that, combined with Java's Exception model (great way to trap runtime issues without breaking the program), plus the java.net API which gives you excellent networking code, plus some runtime stability (arguable, I know, but I think that I can code a large Java program to be more stable than Netscape 4.x), makes for an excellent platform, IMHO. Again, arguable, but I've had much success in Java (I am a Senior Developer at my company, but I won't get into details), and I'm quite pleased with the direction things are taking. I don't work for Sun - this opinion is unsolicited, I promise you.
Start such a project, and stick with it, and I'd be happy to join, if you want to open source it! The pressure will be to not get tired or bored of the project, because geez - it really is monolithic! Web browsers have gone beyond the Mosaic days - there's a hell of a lot to worry about in there! The advantage is, there's a lot of projects which have started and faltered. Maybe it'd be good to scoop them up and build on their previous efforts.
You can accomplish anything you set your mind to. The impossible just takes a little longer.
Lose the Java support, and you've got a fantastic browser in Opera in just over a 2MB download, which seems to support just about everything you described. If you want Java, it's closer to 10.
I don't think it could get much smaller, because of the complexities involved in the increasing scope of the HTML standards, JavaScript, CSS and the like, plus the fact that they seem to be writing the code to be reasonably portable.
If you really want to get insane, I'm sure somebody COULD write a browser in hand-coded assembler to be extremely small, but the benefits would be outweighed by the sheer difficulty in maintaining this code and loss in portability.
Want a lightweight Mozilla for Windows? Try Kmeleon. Stripped down, but is fast and small (about 3MB), as well as free, and seems reasonably stable too. I use this and am pleased with it, but I prefer Opera still because it's been in development longer and seems to be more consistent in its rendering capabilities.
You can accomplish anything you set your mind to. The impossible just takes a little longer.
If you ever have the chance, take a look at the now famous QNX demo disk (available here). It's a full OS with a fairly capable (graphical) browser that seems to meet your requirements, and the entire thing fits on a 1.44MB floppy. If they can fit all that on a floppy, I'm impressed.
With a little more digging on their site, I found this information page which offers some more details on their browser. it's called Voyager, and it supports frames, JavaScript, and almost all common html tags, and it fits in less than 400k. Even more information on the Voyager browser can be found here.
I hope this is of some help.
-Jason
If I could only live my life with my threshold at 4...