Brad Fitzpatrick (brad) wrote,
Brad Fitzpatrick
brad

JSBorg

Problem statement:

-- JavaScript debugging/testing blows (blows = inconvenient/slow)
-- DOM support varies so much
-- some DOM inspectors are good, some are okay, some are non-existent
-- Reloading 7 browsers with Alt-Tab, F5, Control-R, Alt-R, and moving the mouse gets tedious (even with x2vnc, Synergy, etc)

Introducing:

JSBorg!
.... controlling all the browsers from one console

Basically I wrote:

-- a Perlbal plugin to implement a stupid message bus between JavaScript clients (just using HTTP)
-- a stupid JavaScript library to XmlHttpRequest GET a command and eval it
-- a stupid readline app that injects commands into the bus.

And there you go.... I now have a JavaScript shell that evaluates on all browsers in parallel now:




(Not pictured: Windows w/ Opera and IE.... you get the idea)

Next up: a JSBorg.log(...) function so I can do:

JSBorg> log = JSBorg.log;
JSBorg> log($("someStupidDiv").offsetTop)
IE 5.5: 234
Firefox 1.5: 237
Firefox 1.0.7: 234
Safari: 752
(end results)
JSBorg> log(is(DOM.someFunc(node), 54, "someFunc works"))
IE 5.5: pass
Firefox 1.5: pass
Firefox 1.0.7: pass
Safari: fail
(end results)

And basically then have automated test suites of JavaScript libraries, writing stuff on top of the injector. (or write an injector library, more likely)

And then I'm thinking a global DOM inspector that checks all the DOMs in parallel.
Tags: javascript, tech
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 11 comments