This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
SquidDev's profile picture

BobCat - Web browser (Sub Alpha)

Started by SquidDev, 03 June 2014 - 01:56 PM
SquidDev #1
Posted 03 June 2014 - 03:56 PM
I know what you're thinking, Firewolf is amazing, why are you trying to replicate it? The answer is I'm not, BobCat is based on Lynx, the text base web browser. BobCat renders HTML using the HTTP protocol (though you can access local files as well). This means you can access real life websites, from your Computer Craft terminal.

This is still in heavy development, I'd just thought I'd show you what I have so far:

Screenshots:
SpoilerA basic web site.

Installation:
You can either get it from my GitHub or:
pastebin get txWFGCHQ BobCatAPI
pastebin get WvXvCTJ9 BobCat

Then just run it with BobCat.

Contributing
I'd love to you contribute, Its on GitHub so please send me a pull request.

Remember, this is still in development so 99% of HTML is not implemented.

RoadMap
SpoilerWhat needs changing:
  • More liberal HTML parser, at the moment the HTML needs to be 100% perfect.
  • All tags supported - table, bold, headers
  • Links actually are clickable
  • Anchors
  • Form submission
What I won't add:
  • CSS
  • JavaScript
  • Images
Edited on 03 June 2014 - 04:16 PM
Saldor010 #2
Posted 03 June 2014 - 06:03 PM
First thing I thought when I saw this thread. "Seriously? ANOTHER FREAKING REDNET BROWSER?" But just so I'm clear on this, once this is done, you will be able to read text on real life websites?
SquidDev #3
Posted 03 June 2014 - 06:15 PM
First thing I thought when I saw this thread. "Seriously? ANOTHER FREAKING REDNET BROWSER?" But just so I'm clear on this, once this is done, you will be able to read text on real life websites?

Yep, it will be pretty limited - no CSS and few colours but generally, yes.
Edited on 03 June 2014 - 04:15 PM
Saldor010 #4
Posted 03 June 2014 - 06:41 PM
First thing I thought when I saw this thread. "Seriously? ANOTHER FREAKING REDNET BROWSER?" But just so I'm clear on this, once this is done, you will be able to read text on real life websites?

Yep, it will be pretty limited - no CSS and few colours but generally, yes.

Awesome.
Geforce Fan #5
Posted 05 June 2014 - 02:37 AM
I can't find a single website that works on this.
SquidDev #6
Posted 05 June 2014 - 08:08 AM
I can't find a single website that works on this.

At the moment it only works with very basic HTML - nothing too complex. The HTML parser is very strict and so will break if it finds something it isn't expecting - this is something I am planning to fix but will take time. As I said:

Remember, this is still in development so 99% of HTML is not implemented.
GravityScore #7
Posted 05 June 2014 - 08:40 AM
I vote to implement the <blink> tag! :P/>

Nice job on this, it'll be cool when it's done :D/>
SquidDev #8
Posted 05 June 2014 - 08:48 AM
I vote to implement the <blink> tag! :P/>

Nice job on this, it'll be cool when it's done :D/>

Why not <marquee> whilst we're at at?
kla_sch #9
Posted 06 June 2014 - 08:49 AM
I vote to implement the <blink> tag! :P/>

Thumbs up!

[indent=1]And the beast shall come forth surrounded by a roiling cloud of vengeance. The house of the unbelievers shall be razed and they shall be scorched to the earth. Their tags shall blink until the end of days.[/indent]
[indent=1]from The Book of Mozilla, 12:10[/indent]

https://www.mozilla.org/en-US/book/
SquidDev #10
Posted 06 June 2014 - 09:23 AM
I vote to implement the <blink> tag! :P/>

Thumbs up!

[indent=1]And the beast shall come forth surrounded by a roiling cloud of vengeance. The house of the unbelievers shall be razed and they shall be scorched to the earth. Their tags shall blink until the end of days.[/indent]
[indent=1]from The Book of Mozilla, 12:10[/indent]

https://www.mozilla.org/en-US/book/


From the source of that page:

<!-- 10th December 1994: Netscape Navigator 1.0 was released -->
<!-- This verse announces the birth of the beast (Netscape) and warns bad coders (up to Netscape 3, when you watched the HTML source code with the internal viewer, bad tags blinked). -->
<p class="moztext">
And the beast shall come forth surrounded by a roiling <em>cloud</em> of
<em>vengeance</em>. The house of the unbelievers shall be <em>razed</em>
and they shall be <em>scorched</em> to the earth. Their tags shall <em>blink</em>
until the end of <em>days.</em>

The blink means bad tags.

I don't think this would be easily achievable. To keep the rendering fast I render once to a buffer and then just blit the buffer to the screen every time there needs to be an update, helping keep it running fast. With blinking tags I'd have to be redrawing the buffer, loosing performance. If you find me a genuine site using <blink> then I will think seriously about implementing it.
MKlegoman357 #11
Posted 06 June 2014 - 11:09 AM
I don't think this would be easily achievable. To keep the rendering fast I render once to a buffer and then just blit the buffer to the screen every time there needs to be an update, helping keep it running fast. With blinking tags I'd have to be redrawing the buffer, loosing performance. If you find me a genuine site using <blink> then I will think seriously about implementing it.

I would say, "Do it!". Rendering to a buffer takes less than a millisecond, I had 2 ifs comparing values from 2 tables, hundreds of thousands of checks per 0.1 second, in Minecraft Server. The only thing that may (notice italized text) is if your renderer would be inefficient, and even that wouldn't cause too much lag.