bard / mozrepl

Remotely control Firefox and other Mozilla apps with JavaScript
https://github.com/bard/mozrepl/wiki/
510 stars 64 forks source link

node.js module please? #46

Open kamathln opened 11 years ago

kamathln commented 11 years ago

nodejs module where we can connect and then start using the remote objects directly as if local?

var moz = require('mozrepl'); var conn1 = moz.connect('127.0.0.1' , '4747'); var conn2 = moz.connect('127.0.0.1' , '4748');

var gbrwoser1; var gbrowser2;

if (conn.connected=true){ gbrowser1=conn1.otherEnd.content; }

if (conn2.connected=true){ gbrowser2=conn2.otherEnd.content; }

//start using "window" of the other end as if its local. if (gBrowser1.location.href == gBrowser2..location.href) { gBrowser1.alert('hey! the other browser has the same page open .'); gBrowser2.alert('hey! the other browser has the same page open .'); }