top | item 1648553

Node.js used to mirror DOM across browsers

64 points| kurotek | 15 years ago |screentoaster.com | reply

45 comments

order
[+] peteforde|15 years ago|reply
I am not prone to melodramatic statements, but seeing this I had the same feeling I had the first time I started using GMail.

It's not necessarily the DOM sharing, which is cool enough. I just think that the emergence of sockets in new browsers is going to bring in the "next level", whatever that ends up being.

Seriously incredible, especially considering the development timeframe.

[+] points|15 years ago|reply
It's fun, yes, but at the same time, it's nostalgic.

We've had such technology for decades. There have been desktop sharing apps for years, in Java applets etc.

So whilst it's cool that the browser wars are generating a ton of improvements, none of them so far are really things that will blow users minds. HTML5 is just catching up to where other platforms were 10 years ago.

[+] InclinedPlane|15 years ago|reply
Websockets, local storage, canvas, css3, fast and standards-compliant Javascript engines, and any other delicious candy that gets piled on top. It's like Christmas for web-devs, this is a good time to be building web apps, we're going to see some amazing stuff.
[+] mcmc|15 years ago|reply
This is a cool demo; props to the guys who made it.

I have done a few demos like this, and it turns out to be surprisingly hard to turn it into a product. For instance, just because you can send over changes to the DOM, you can't necessarily reproduce the javascript side-effects, exactly. You can't just poll the state of the DOM because it doesn't reflect all of the state that lives in javascript closures that you can't even see.

One easier method, and probably what they did in this demo, is simply catch any user-generated event in browser A and re-emit it in browser B, thus letting the existing javascript code / browser logic do any actual DOM/state modification.

But what happens when each user triggers an DOM event at the same time? They end up getting applied in reverse order on the two browsers. In many cases this can cause the two browsers to fall out of sync.

Anyway, I love seeing WebSocket demos, and this is pretty fun. Just be sure you realize what a rabbit hole this is if you want to make a product.

[+] mike-cardwell|15 years ago|reply
I'd love to be able to just add a script tag to my website, and then log into some web based service which shows me a list of the current sessions on my website allowing me to click on one of those sessions and monitor their progress through the site using this dom mirroring technique.

There must be money to be made in this sort of service?

[+] symmet|15 years ago|reply
That's definitely one of our ideas for pushing this further!
[+] MisterWebz|15 years ago|reply
Sounds like a novel way of stalking.
[+] Groxx|15 years ago|reply
Pretty cool, potentially very handy, though I wonder why they didn't synchronize scrolling.
[+] js4all|15 years ago|reply
I asked myself the same. Anyway this is an impressive demo and I voted accordingly. :)
[+] lyime|15 years ago|reply
Really good demo. I see multiple business ideas in there.
[+] statenjason|15 years ago|reply
Definitely has potential for the live support market
[+] Kliment|15 years ago|reply
Sounds like a security risk to me. If someone tricks you into starting this they could follow you to other websites and collect data.
[+] tlrobinson|15 years ago|reply
Security risk in what? Users not paying attention to the URL bar?
[+] CrabDude|15 years ago|reply
There's nothing here that a simple XSS attack couldn't do in terms of security risk which at least doesn't declare to the world "The owners of this URL are hax0rs!" As a company, all we have to do is throw a loud red banner across the top of the page, etc...
[+] _urga|15 years ago|reply
I was thinking through something like this just last night, after reading up on Smalltalk and system images. Are you loading each domain in an iframe? How did you manage to overcome Twitter's clickjacking protection? Using the new sandboxed iframe attribute? High five!
[+] CrabDude|15 years ago|reply
It's done via proxy, node.js, and websockets =) No iFraming. Since we're proxying, we can dynamically hijack the links and insert JS.
[+] phoenix24|15 years ago|reply
this is cool!

I made a similar nodejs application too sometime back, but mine is still with some bugs.