During your development you fire up a Node.js server and include a script tag on your site's pages pointing to a JS file on the server. From then on a events fired on one device are beamed to all your other devices viewing the same site.
No requirement to install an app on the device means you can test any device with a browser: smart TV, games console, kindle, washing machine...
Currently supported events are
When an event is fired, any HTMLElements in the event object are converted to CSS selectors and the event is broadcast to the other connected clients. The element on the clients must be matched by that selector or the event will be ignored.
click events are captured by delegation on the document. If other handlers stop propagation they won't fire.
blur events don't bubble so handlers are added to input and select elements on domready. If elements are appended later, events from these elements won't be broadcast.
There is no real way to detect a browser refresh or back/forward. You can add ?gsdriver=1 to your main client and any time a page is loaded, that URL will be broadcast to the other clients. The pages are then changed with
window.location which isn't the same thing as navigating through the history. This flag is saved in a cookie. Append ?gsdriver=0 to clear this.
In your shell:
$ node server.js
In your web pages:
In your browsers:
OR - to transmit page refreshes from one main browser to the others:
- Add fake back/forward buttons to the driver
- include weinre/aardwolf option?
Copyright (c) 2012 stevoland
Licensed under the MIT license.