Giter Site home page Giter Site logo

iepster / collaborative-virtual-browser Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pongells/collaborative-virtual-browser

0.0 1.0 0.0 305 KB

Example of using PhantomJS with Node, Angular and Socket.io to create a Virtual Browser which may be used by multiple devices collaboratively.

License: MIT License

JavaScript 92.32% CSS 1.55% HTML 6.12%

collaborative-virtual-browser's Introduction

Collaborative Virtual Browser

Example of using PhantomJS with Node, Angular and Socket.io to create a Virtual Browser which may be used by multiple devices collaboratively.

This is an extract from my Master Thesis at ETHZ (GlobIS): An infrastructure for cross-device mashups

Installation

Install PhantomJS and add the runnable to the PATH env. variable (i.e. typing phantomjs in a terminal should start PhantomJS).

Use package.json (the usual npm install in the main folder) to install the Node modules.

Go into the public folder and use bower.json (the usual bower install) to install the client dependencies.

How does it work?

Pages are open inside a virtual browser (PhantomJS) which simply put is like a real browser, but running on the server (no need for a GUI).

Once open, the page DOM is extracted, modified and sent to the interested clients. Since we are using Socket.io for communication, users interested in a page join the Socket Room called pageId.

Events on the client (click, change, submit) are sent to the server, which replays them inside the virtual browser and then sends the result back.

You can see it as a remote desktop kind of application, but with js and html pages.

##Note Disable logging if it gets slow. I am printing a shitload of stuff. Each time a page changes or it finishes loading resources, the whole page is sent to the registered clients.

A batter way to do this would be to use MutationObserver (or some other trick) and only send updates instead of the whole document.

Tools

Server:

  • Node.js
  • Express
  • Jade
  • Socket.io
  • phantomjs-node
  • Cheerio

Client:

  • AngularJS
  • Socket.io
  • angular-socket-io
  • Bootstrap 3.0
  • jQuery

collaborative-virtual-browser's People

Contributors

pongells avatar cengiz-io avatar

Watchers

Epi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.