WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: FLOW: a deplorable web browser in only 19 KB  (Read 6970 times)

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 503
  • Good software needn't be big!
FLOW: a deplorable web browser in only 19 KB
« on: July 19, 2009, 03:54:06 PM »
When Chimera2 is just too big...  :P

Did you ever notice that the FLTK 1.1 library has a Fl_Help_View class that renders some ( ;)) HTML?  Wouldn't it be great to make a web browser with that?  And use wget to fetch the web pages and images?  And have a bit of other FLTK GUI to make it easy to navigate?  Well, I did, and I was able to create an FLTK executable that is less than 19 KB!  Here is a screen shot of my alpha version.

I'll post a .tce below if you'd like to try it.  It just has a few (   ::)  ) limitations, which I'll outline below.

FLOW: the Fast Light Openner of Webpages
--
Mike Lockmoore
« Last Edit: July 19, 2009, 04:25:11 PM by MikeLockmoore »

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 503
  • Good software needn't be big!
Re: FLOW: a deplorable web browser in only 19 KB
« Reply #1 on: July 19, 2009, 04:24:37 PM »
OK, here's a few things you need to give up if you'd like to run FLOW:

0) Flash: no YouTube, Flash games, site intro animations, etc.
1) Client side scripting: no JAVA, javascript, etc., etc.
2) HTTPS encryption
3) Cascading Style Sheet (CSS) formatting
4) Frames
5) Forms and form submission
6) Most table formatting
7) Almost all character formatting
8) Basically, any attributes introduced about the time of HTML 2.0
... and probably dozens of other things.  But for everything else, you are golden!

Turns out, the Fl_Help_View window class has extremely limited HTML rendering capability.  Limited to:
1) Basic text
2) Header classes (<h1>, ... <h3>)
3) Unordered lists (but not ordered ones!)
4) Very basic tables
5) Inline images
6) Hyperlinks, including in-page links

That's basically it.  I thought it may be possible to implement forms using FLTK widgets floating on top of or next to the Fl_Help_View window, but it turns out the busybox version of wget is also very limited, and cannot use a POST type request needed for many form submissions.  

So, with these limitations, FLOW is basically useless for 95% (99%?) of web sites created after 1997 or so.  Actually, the tinycorelinux.com site is mostly navigable, and save for the missing header image (loaded through its CSS file), most pages are readible, but the screenshot area is not, nor is the forum.

So if you are brave enough to continue, you can try the .tce attached below.  You can pass a URL into the command-line:
# flow http://www.mywebsite.com/

Please always append a / at the end of your URL's unless you have a fully-qualified web page (e.g. # flow http://www.mywebsite.com/index.htm).  If you want to open a local file, the command-line is

# flow file:/path/to/my/file.ext

FLOW will fetch the raw web page using wget into /tmp/cache as the file step0.tmp.  Then it does some cleanup operations, resulting in step1.tmp.  Then it chops out all blocks of <script> ... </script> code, saving it as step2.tmp.  Then it pre-fetches any linked images, and rewrites those a fully-qualified URLs, resulting in the file FLOW_current.html.  This is the content of the FLOW browser window.  All image files will be also cached into /tmp/cache under its filename+ext.  It will track a few dozen sites in the history (so the Back and Next buttons work).  I don't have any mechanism for changing the home page, but you can start with any URL if you use the command-line to start it.

Given the limitations described above, I don't think I will be taking FLOW beyond this alpha release (at least not with these building blocks).  It was fun to create and experiment with, but my future effort will probably be better spent in other areas.  The Dillo web browser also uses FLTK, but it's using the pre-release FLTK version 2.0, which is not built into TC.  So maybe I could back-port Dillo (or at least a useful subset of it) to FLTK 1.1.  Or maybe I could extend Chimera2 to use FLTK to have a more modern GUI.  Or maybe I'll get around to making my own from-scratch browser just for fun (although I have a few other project ideas that might be more worthwhile).

Maybe for fun, you can post the many horrible ways you can make FLOW crash and burn!   ;)
--
Mike Lockmoore

[^thehatsrule^: please recall the guidelines; attachments removed]
« Last Edit: July 20, 2009, 10:49:22 AM by MikeLockmoore »

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: FLOW: a deplorable web browser in only 19 KB
« Reply #2 on: July 19, 2009, 10:01:56 PM »
.  The Dillo web browser also uses FLTK, but it's using the pre-release FLTK version 2.0, which is not built into TC.  So maybe I could back-port Dillo (or at least a useful subset of it) to FLTK 1.1.

http://forum.tinycorelinux.net/index.php?topic=2070.0

Offline ^thehatsrule^

  • Administrator
  • Hero Member
  • *****
  • Posts: 1726
Re: FLOW: a deplorable web browser in only 19 KB
« Reply #3 on: July 19, 2009, 10:46:40 PM »
There is the fltk `help` which may be of interest (included in TC).

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: FLOW: a deplorable web browser in only 19 KB
« Reply #4 on: July 20, 2009, 08:23:13 AM »
Hmmm...  Probably needs Flash 10.   ;D
32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 503
  • Good software needn't be big!
Re: FLOW: a deplorable web browser in only 19 KB
« Reply #5 on: July 20, 2009, 10:50:15 AM »
Lee: Good point.  I ammended the list of sacrifices.  :D

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 503
  • Good software needn't be big!
Re: FLOW: a deplorable web browser in only 19 KB
« Reply #6 on: July 21, 2009, 06:16:34 AM »
I was not supposed to post my .tce here directly (sorry  :-[).  If there is anyone interested in trying it out, please let me know and I will post the source code here.  I do want to give notice that I would like to reserve the name FLOW for any future FLTK-based web browser I help author, even if it does not derive directly from this early rough version.

But I'd like ask for opinions on whether there is any demand for a really lightweight FLTK-native browser (smaller than Dillo).  Dillo is statically linked to the still-in-development 2.0 version of FLTK, so you can use it, but it is duplicating some (much?) of the functionality already available in the shared FLTK libraries (version 1.1.9) that come in the TC base.  So a web browser whose rendering and GUI are written as a FLTK 1.1.x app should be, in principal, much smaller than the 2.x series of Dillo. 

Of course, one guy or very small group of people probably cannot rival the accomplishments of the 10 to 15 people working on Dillo or the much larger teams working on Opera, Firefox, et cetera.  But maybe it would be nice to have a basic FLTK-based browser available in TC that people can use to access the TC website, forums, and wiki.  We could try to make sure that for these TC-specific sites, the native browser works well (maybe better than Dillo, given some comments I've seen elsewhere in the forum).  And it could be somewhat useful for other browsing, but not be a real alternative if you need a full-featured browser.  So, I'd like to hear what you think.
--
Mike L.
--
ML

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7035
    • My Community Forum
Re: FLOW: a deplorable web browser in only 19 KB
« Reply #7 on: July 21, 2009, 06:36:26 AM »
But maybe it would be nice to have a basic FLTK-based browser available in TC that people can use to access the TC website, forums, and wiki.  We could try to make sure that for these TC-specific sites, the native browser works well (maybe better than Dillo, given some comments I've seen elsewhere in the forum).  And it could be somewhat useful for other browsing, but not be a real alternative if you need a full-featured browser.  So, I'd like to hear what you think.

I'm running the same SMF forum like this one. Few month ago I tried Dillo but it was not able to handle the site so I gave it up.

I just tried the latest MIDORI browser on WINDOWS and it is crashing with FLASH content.

While I like small and/or unique solutions and do not like monopoly, I'm sceptic regarding alternative browsers, including GOOGLE CHROME. Sooner or later you have to give up using due to incompatibilty problems. Like a car which starts 80 percent when you want to drive.

Special tools accessing HTML content via the NET is a different stuff.

Of course this is just my personal view.

Regards... Béla
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline florian

  • Full Member
  • ***
  • Posts: 116
    • Home Page
Re: FLOW: a deplorable web browser in only 19 KB
« Reply #8 on: August 13, 2009, 01:01:12 PM »
Hi Mike, it would be nice to try FLOW. Did you publish an extension and/or source somehwere?

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 503
  • Good software needn't be big!
Re: FLOW: a deplorable web browser in only 19 KB
« Reply #9 on: August 25, 2009, 05:57:15 AM »
Florian:

I sent you a PM some days ago re: FLOW.
--
ML

Offline florian

  • Full Member
  • ***
  • Posts: 116
    • Home Page
Re: FLOW: a deplorable web browser in only 19 KB
« Reply #10 on: August 25, 2009, 08:22:27 AM »
Got it mike, Thanks. Sorry for the late response. Been very busy lately.

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 503
  • Good software needn't be big!
Re: FLOW: a deplorable web browser in only 19 KB
« Reply #11 on: August 31, 2010, 10:12:05 AM »
@technosaurus: I still have the files I worked on.  ::)  I quickly realized the HTML Browser wiget built into FLTK is extemely limited, and could not render a lot of really simple things, let alone frames, CSS and other more modern things.  So I started working on a fancy-text rendering FLTK window that could match most of the basic HTML 3/4 level of formatting at least.  I got it to a semi-reasonable level, but it is still far, far short of a real browser.  But I've sidelined it while working on some other FLTK stuff...

Flit 1.21 - out now, supporting ALSA sound and OLPC power monitoring

FL-PicSee 1.2x... beta posted already, adds slideshow, image type recognition, better keyboard handling.

Flume... a fast, light utilitarian math environment: it's a calculating math scratchpad, sorta one-column spreadsheet thingy. Has simple command-line mode or normal FLTK gui.  I plan to post it in the next few weeks, after I expand and polish the help file a bit more.

Flea... "Flea likes editing all" text editor.  Didn't get too far with this yet.  Intended to work a lot like Geany for simple programming tasks, but only using FLTK.

Fluff... a fast, light utility for files: a FLTK-native file manager... this is only partially implemented and still quite buggy, but I'm actively working on it in my spare time.  XFE is my model, with a few aspects of Nautilus and/or Windows Exploer, but I'll do alpha releases once I get it to cleanly browse files, do copy/move/delete, and some simple flie-based application launching.

Yes, I think about getting back to Flow someday.  But I am prioritizing Flume and Fluff first. 

Offline roberts

  • Administrator
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: FLOW: a deplorable web browser in only 19 KB
« Reply #12 on: August 31, 2010, 02:54:48 PM »
Mike, we will be looking forward to your new projects.
10+ Years Contributing to Linux Open Source Projects.

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 503
  • Good software needn't be big!
Re: FLOW: a deplorable web browser in only 19 KB
« Reply #13 on: August 31, 2010, 09:20:57 PM »
Here's a teaser screenshot...
 ;)

Offline roberts

  • Administrator
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: FLOW: a deplorable web browser in only 19 KB
« Reply #14 on: September 01, 2010, 08:27:46 PM »
Very nice. I am so looking forward to more "small is beautiful" apps!
I have been hoping that this project would attract some FLTK programmers to contribute tiny apps.
You and Brian have done some nice things within our tiny framework.  :)

10+ Years Contributing to Linux Open Source Projects.