Fork me on GitHub

Queen

Runs scripts on many browsers

A platform for running scripts on many browsers

Let's say you want to play a game where you write down a number and others try to guess it. You gather some friends and tell them to start giving numbers at you. Your friends keep giving you random numbers until one of them gets it right.

Now imagine your friends are browsers, and the game is a script which tells browsers how to play, and waits for the right number to be guessed. This makes you the Queen Server. The Queen Servers allows you to perform distributed tasks on many browsers -- a platform for running scripts on many browsers.

Let's run the example:

  1. Install Node.js version 0.8 or higher
  2. In your terminal, run:
    sudo npm install -g queen
  3. Run:
    queen -c localhost:9300 http://queenjs.com/server-example.js
  4. Click here and watch your terminal.

Here's what happened:

  1. You installed software that allows you to run JavaScript code through the command line.
  2. You installed queen using a package manager that comes with Node.
  3. You asked queen to start capturing browsers on localhost port 9300 and run this server-side queen script.
  4. You pointed your browser to the queen server, allowing queen to push code that the server-side script requested to run on browsers (the "client-side script"). When this client-side script loaded, it started reporting back to the server-side script random number guesses. Once the server-side script saw the correct number, it ended the process.

It's not for guessing numbers

Queen is a server which captures browsers and then is able to push scripts to them to run in a clean context (an iframe). Here are somethings it can do out of the box:

Queen is the foundation of Thrill, a test runner for web applications.

Rule your Browser Kingdom

Queen bears the Apache License 2.0. Read this to get starting on hacking queen. Your contributions are welcome at GitHub.

Created by Ozan at Turn.