Webkit.js - Who Needs A Browser?
Written by Mike James   
Wednesday, 05 February 2014

Is this JavaScript's ultimate step towards world domination? Webkit is a full strength industrial HTML rendering engine - and guess what so is webkit.js, only it's a JavaScript program. So who needs a browser?

 webkitlogo

OK, I admit that webkit.js isn't actually "industrial strength" at the moment, but it is another example of what you can do when you think outside the box. The method is straightforward - take the current WebKit code and feed it through the Emscripten C++/C to JavaScript compiler and the rest is a matter of making it work. In this case "the rest" is quite a lot of work. 

Currently there is a lot that isn't working and the code is more a proof of concept than anything practical. It can, however, render some tags onto a WebGL surface in Chrome. 

At the moment this is the work of a single programmer, Trevor Linton, so if you feel like a challenge visit the GitHub site to see if there is anything you can do. The goals of the project are: 

  • Produce a renderer in pure JavaScript that supports rendering to WebGL/Canvas contexts.
  • Develop frameworks for image/webpage capturing and automated web testing (similar to PhantomJS).
  • Develop a framework for prototyping CSS filters, HTML elements and attributes.
  • Experimental harness for pure javascript rendering performance.
  • Develop a javascript based browser in nodejs (just for fun)

Notice the final goal - a JavaScript browser that runs under node.js. Yes you could in theory get away with a "browser" that was 100% JavaScript. There would be no HTML rendering engine just a JavaScript engine and the rest would be JavaScript code. 

Are there any advantages to this?

The most obvious one is that JavaScript finds it very easy to interwork with JavaScript, so perhaps the split between code that makes up the browser and code in the web page would vanish.

This is partly the case with the Firefox Gecko layout engine where an HTML like markup, XUL, provides the user interface, i.e the chrome, and XPCOM allows JavaScript access. But a pure JavaScript rendering engine could provide another level of "chrome-client" interaction. 

When you think about it, a JavaScript HTML layout engine makes a lot of sense. 


webkitlogo

More Information

Webkit.js

Related Articles

Asm.js Gets Faster

js2js The Revolution In JavaScript

Vanilla JS Used On More Sites Than jQuery

JQuery Ever More Popular

Getting Started With TypeScript

Java, ASM.js Or Native - Which Is Faster?       

 

To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, FacebookGoogle+ or Linkedin,  or sign up for our weekly newsletter.

 

espbook

 

Comments




or email your comment to: comments@i-programmer.info

 

Banner


Windows 11 Adoption Takes A Downturn
11/12/2024

With Windows 10 End of Life only ten months away, Microsoft is stepping up its campaign to get Windows users to upgrade to Windows 11. But while Windows 11 had been gaining users at a steady rate at t [ ... ]



Use Javascriptmas To Hone Your Webdev Skills
08/12/2024

Every day until December 24th MDN, in partnership with Scrimba, is releasing a daily challenge, which as the name suggests requires you to practice your JavaScript skills. Each solution you submi [ ... ]


More News

Last Updated ( Wednesday, 05 February 2014 )