Webkit.js
trevorlinton.github.io
trevorlinton.github.io
https://www.destroyallsoftware.com/talks/the-birth-and-death...
Impressive. I can't say I see the practical implementations of this, but I'm sure there's some. But it's impressive nonetheless.
Theoretically, now you could render the DOM to a texture instead of to the screen and do some sweet deferred rending.
== Edit ==
Looks like one of Mozilla's Distinguished Engineers blogged about the technique. [1] [2] The creator of emscripten used this technique to render tweets as a texture in the bannabread demo. [3]
[0] https://medium.com/@deathcap1/six-months-of-voxel-js-494be64...
[1] http://robert.ocallahan.org/2011/11/drawing-dom-content-to-c...
[2] https://developer.mozilla.org/en-US/docs/Web/HTML/Canvas/Dra...
The nice part about CSS 3D transforms is that interactivity is maintained, and it's still hardware-accelerated. A fantastic example of this was made by the creator of Three.js over a year ago:
http://mrdoob.com/lab/javascript/threejs/css3d/
As you said above, there are severe drawbacks with that approach. It is very limited in terms of what's possible compared to a traditional 3D scene. Moreover, since CSS 3D transforms are essentially DOM content rendered to a texture, rasterization occurs, and as such there isn't clean scaling, even with SVG content.
var texture = new THREE.Texture(theCanvas);
texture.needsUpdate = true; //refreshes the texture from the source canvas
Now combine it with React.js to avoid redrawing unless necessary and forward the mouse events back to Webkit.js, and you have an interactive HTML texture :) <html>
<body>
<iframe src="http://trevorlinton.github.io/"></iframe>
</body>
</html>Here, I'll give a simple example. Let's say there's a site that uses cookies to track logins. For example, hacker news. Now, hacker news does have the X-Frame-Option Deny, but let's assume it doesn't.
So to figure out my hacker news username, all you have to do now is create an iframe with hacker news, and then getPixel on the area of the frame that contains usernames, run some trivial OCR, and done.
Now, this issue is even more serious in other instances. For example, google talk widgets are embedded by iframes I believe.
In both these cases, a fresh rendering would still have the inappropriate material due to cookies. If cookies aren't sent, e.g. you do a fresh render in a private tab, it would still have security concerns for anything that displays different, sometimes private, content based on ip address.
For an example of that, you could render "private.internal.company.localsite" in an iframe and if a visitor from that company visited, even a cookie-less load would probably show private data due to the internal site relying on ip/nat controls.
On an information only webpage (no user interactions) there's no need to have the X-Frame-Options to remain secure. If there's a way to access the data in that frame suddenly, that changes the necessity of that header.
https://developer.mozilla.org/en-US/docs/Web/CSS/element
I've written GUI builders that really could have used this for icons of views. Instead I had to render on the server. It'd be nice if it got more broadly adopted.
Also, even though people tend to not like this kind of thing here, it has to be said: Yo dawg...
GMail, a webapp email reader, is currently taking 368MB of RAM. Insane!
Maybe someday we'll code apps in Objective-C/Java that run in the browser, all inside a canvas.
https://developer.gnome.org/gtk3/stable/gtk-broadway.html http://www.youtube.com/watch?v=fr8eo4RlPw4
Please make it easier. More simple.
You know all those malware issues regarding unsigned or compromised executables? Not a problem in the wonderful world where programs are incapable of acting overly malicious. There're specs like webgl and webcl that lets you take the scary topic of graphics programming, which is communication to an external piece of hardware, and make that as safe as loading some javascript to sort a table by dollar value.
</rant>
Open FTW.
(Also WebGL support is new in iOS). Are people really clamoring for the Firefox engine to be supported in iOS?
For instance, as of about a week ago Safari on iOS just got WebGL support (as you alluded to). How long would we have had WebGL support on iOS if we could ship an alternative browser engine implementation with competitive JIT'ing JavaScript engine (like Firefox's Gecko & SpiderMonkey engines) on iOS since the beginning? Would alternative browser engines with more APIs drive the Safari for iOS team to ship features faster? Bottom line: competition is healthy; developers and thus users win.
Which is not possible on FirefoxOS. So I don't see how 'open' wins here (I'm using 'open' as the GP used it: a marketing buzzword synonymous with Mozilla).
For example, what if Mozilla had leverage over device manufacturers to say "no locked bootloaders" and device manufacturers complied? I'm not sure Mozilla has that leverage today, but what other ways could Mozilla affect the industry for good once it does?
[0] https://github.com/nickdesaulniers/What-Open-Source-Means-To...
No, they forked Webkit due to all the browser related #ifdef's they had scattered across the source code. They were diverging to much and damaging the quality of the code.
https://en.wikipedia.org/wiki/Blink_%28layout_engine%29
Edit: They're still pretty similar, though.
I don't see much difference between a single party and a cartel of 3-4 parties. They are all mega corporations that don't share my interests and even when there are several parties any one effectively has veto power over any changes to standards.
The push for browser-as-OS is only going to make things worse. You don't get any browser choice at all when your hardware is running ChromeOS or FirefoxOS
Both browser based OS's are still in their early phases. What if the hardware could run both, just as easily as you could put whatever flavor distro of linux on your desktop?
There's too much closed source OS specific drivers to really allow you to run whatever OS you want on whatever hardware you want; and everyone is disincentivized unless money is involved. But what if drivers were open source? I'm not sure how to incentivize that (the community fixing shitty GL driver implementations, maybe), but I would bet you it would be a hell of a lot easier to get you favorite software running on your favorite hardware if they were.
Right now, closed source drivers are a thorn in the side of users having choice. With the rapid progression of the Mesa project in particular, when hardware manufacturers come around to releasing their drivers, then ChromeOS, Firefox OS, and Tizen will be poised and in a good position.
This isn't a valid replacement for just being able to run multiple browsers. Switching OS has a large cost. Your FirefoxOS local apps won't run on ChromeOS (and vice versa). You have to work out how to get your files from one to the other and so on. If you want to just try another browser out you have to go through a process that is very intimidating and complicated for most people. The average user is not going to do it (or if they are persuaded to do it many will get angry and complain that all their apps are gone).
Making the cost of switching browsers much higher is an attempt to lock people in to a single browser.
When your OS is no more than a browser, what is the difference?
It really doesn't matter if it's possible to work around these hurdles to changing OS, it's still a massive amount of effort to think about all these things rather than just being able to install a different browser alongside. Normal users will not be re-imaging their phones to different OSs just to try a different web browser. It just won't happen in any great numbers. After a hard fought battle over many years to get people over the relatively small hurdle of installing Firefox on open platforms, I would expect Mozilla of all people to appreciate how difficult it would be to get people to try out different browsers in a world.
Also, I know it's kind of taboo to talk about this around here, but it's worth also mentioning what web apps mean for user privacy and data security. You seem to be suggesting that people only use web apps where their data is never stored locally, only in the cloud. In data centres where governments can mine it (often without warrants or any kind of due process), where it can be mined to build profiles on users for advertising or insurance purposes. That kind of app also leaves user vulnerable to all their data disappearing when the web service they use runs out of money or gets bought out or just decides to ditch a feature.
Doing while preserving security would mean that such a runtime would run sandboxed (in the same way we render web pages with gecko in sandboxed processes). For that to work, the sandboxed process need to delegate some functionality to the "main" trusted process, like network access. This is happening through an ipc protocol (we reused the one from chromium) but the messages exchanged are very much gecko specific currently, so a lot of work would be needed to turn that into a more generic ipc embedding interface.
I'm pretty sure that the folks working on Servo would be very happy to plug in their engine there ;)
Perhaps you are starting to realise that running an open platform isn't as easy as you supposed, and a lot of Microsofts actions were not just "Microsoft is evil" either.
But nowadays, I see it as, multiple companies have a vested financial interest (including MS with their new leadership) to ensure that browsers are very powerful.
Even Apple, with iOS 8 has enabled 3rd party devs to have a full speed browser now with a JIT'd JS engine. They are simply not doing this from a position of weakness. There are no market forces. There's nobody out there saying "I won't use iOS because it only has Safari." Yet they still did it.
Your mobile platform won't succeed today unless it has a powerful browser built in, apps or not.
FWIW, I said it and did it.
I didn't like Safari, and I couldn't change the default browser to anything better. Even worse, most 3rd party apps used their own utter-crap in-app browsers instead.
So I switched to Android where I have freedom to set my preferred default browser, and 3rd party apps actually respect that.
I do agree with the rest of your comment — these days you can't have a platform without a great browser.
Same.
The browsers that are in the Apple App store are handicapped by legal limitations, which are not present on other, more open operating systems.
Is FirefoxOS more or less 'open' than iOS? You can't write a competitive javascript runtime for FirefoxOS either.
[0] https://github.com/mozilla-b2g/B2G [1] http://hg.mozilla.org/
You can't boot your computer into two operating systems at once (or can you?). This whole post is analogous to running Windows in a VM on Linux.
On an open platform I have a choice of web browsers. On a Javascript sandbox based browser-OS I don't have any choice.
>You can't just rip out your OS' implementation of libc and have all of your programs use another (not all implementations of libc are ABI compatible).
I'm not talking about using a different browser engine to run local apps. Obviously there are going to be platform specific APIs that mean things won't be compatible (unless of course Google and Mozilla agree on a set of APIs and don't implement any vendor specific ones at all, but that is highly unlikely since it would mean killing backwards compatibility with current ChromeOS and FirefoxOS apps).
I'm talking about being able to use a different browser stack to browse the web. FirefoxOS makes it impossible to do (with any kind of respectable performance) but it's trivial on a native open platform.
>You can't boot your computer into two operating systems at once (or can you?). This whole post is analogous to running Windows in a VM on Linux.
This is just a silly semantic argument. You are defining the web browser stack as part of the OS just to avoid the awkward reality which is that you have totally locked out all other browsers from your platform. It doesn't make sense to run two kernels (unless you are doing things with a VM) because the role of the kernel is to talk to the hardware. That isn't the role of the browser stack, so there is no reason at all to only allow a single browser stack to run at a time. It's quite possible to run several, which is of course trivially demonstrable on an open platform like GNU/Linux or Windows. If you really want to make analogies, it is more like running a second windowing system. Some OSs like linux make it possible to swap your window manager, others like OS X don't. But the most important thing is that on either you can always just run native software full screen and draw whatever windows you want with no performance penalty (which in this analogy is akin to being able to just browse websites using a third party browser stack, but not being able to run the local apps using it).
http://codeflow.org/entries/2014/jun/08/some-issues-with-app...
Also it's not a matter of "clamoring". People have no idea what they're missing. Do you think anyone would have been clamoring for Firefox on Windows in the 90s for they had never seen it and were limited to IE?
Maybe I'm showing my bias here but remember the browsers before Chrome and V8 came on the scene and heated up the competition? Well there's no competition on iOS because you can't write your own browser. Heck, I'd certainly like to see ASM.JS on iOS as one example.
56 on line 34 in webkit.api.js
Uncaught #<error> on line 15633 in webkit.bin.js
http://en.wikipedia.org/wiki/Brainfuck
so the reasons all the same.
Add it as a feature request on github and i'll add it to the api.
The engines worked, but where are they now? Nowhere. Just like Flash.
No matter how much effort you put into something, no matter how functional it is, now matter how much geek cred you'll get for it, if it doesn't have some sensible use, at least superficially, it'll linger and die. Wasted effort.
Just because you can do something...
I viewed the html source for this page and pasted it. I was quite impressed. It looks like this is supposed to be a browser engine written in Javascript?
So essentially we would have a sandbox browser within a browser? That would be awesome.
There's interesting research being done in the area of meta-circular interpreters. There's techniques for speeding them up; they're not as slow as I'd expect. For example, one interpreter can do type analysis and rewrite chunks of code.
The first thought that comes to mind would be to try to nest the things... a browser inside a browser inside a browser.