Giter Site home page Giter Site logo

browser-repl's Introduction

browser-repl

CLI utility to set up a remote browser repl.

How to use

$ npm install -g browser-repl
$ export SAUCE_USERNAME="your username"
$ export SAUCE_ACCESS_KEY="your key"
$ repl ie6

Sign up for a free OSS account on SauceLabs.

How it works

browser-repl is built on top of the wd module, which is an implementation of the webdriver protocol.

Once a browser session is established, socket.io is used to establish a persistent connection that works on all browsers as fast as possible.

The socket.io server is hosted locally, and a reverse tunnel is set up with localtunnel which gives your computer a temporary URL of the format https://{uid}.localtunnel.me.

The lines you enter are subsequently evald. A global window.onerror hook is also set to capture errors. Summoning repl with the -n argument disables this.

Contributors

License

MIT - Copyright © 2014 Automattic, Inc.

browser-repl's People

Contributors

paulirish avatar rauchg avatar tootallnate avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

browser-repl's Issues

Readme suggestion + browserrepl website

Hey guys. This is incredibly awesome! Good job.

I'd like to make some improvements on the readme file so that developers can find the platforms and web browsers easier. Just let me know if you think its useful.

Furthermore, I think something like browserrelp.com would be awesome. Let developers run the repl online for any platforms. Does it sound interesting?

localtunnel is dead

you might wanna move to ngrok.. idk y almost nobody installs this nowadays because this is cool :D

iOS target rather than iPhone/iPad

Since the repl is about testing the javascript/browser/DOM, the distinction between iphone/ipad doesn't seem too important.

My testing has mostly been about trying older/newer versions of mobile safari for compatibility, regardless of device name and model.

I was thinking of adding an ios target with versions 8,7,6 available. It'd use the iPhone.

Does that sound reasonable?

(We could explore deprecating iphone/ipad but that gets a bit more complicated.)

Error: The environment you requested was unavailable.

Should SAUCE_USERNAME be set to the email address I used to sign up?

~ → export SAUCE_USERNAME="[email protected]"
~ → export SAUCE_ACCESS_KEY="REDACTED"
~ → repl ie6
… setting up tunnel
… booting up internet explorer (6) on Windows XP

Error: The environment you requested was unavailable.
    at /Users/zeke/.nvm/v0.10.25/lib/node_modules/browser-repl/node_modules/wd/lib/webdriver.js:360:15
    at Request._callback (/Users/zeke/.nvm/v0.10.25/lib/node_modules/browser-repl/node_modules/wd/lib/webdriver.js:281:7)
    at Request.self.callback (/Users/zeke/.nvm/v0.10.25/lib/node_modules/browser-repl/node_modules/wd/node_modules/request/request.js:122:22)
    at Request.EventEmitter.emit (events.js:98:17)
    at Request.<anonymous> (/Users/zeke/.nvm/v0.10.25/lib/node_modules/browser-repl/node_modules/wd/node_modules/request/request.js:888:14)
    at Request.EventEmitter.emit (events.js:117:20)
    at IncomingMessage.<anonymous> (/Users/zeke/.nvm/v0.10.25/lib/node_modules/browser-repl/node_modules/wd/node_modules/request/request.js:839:12)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:920:16
    at process._tickCallback (node.js:415:13)
~ → repl chrome
… setting up tunnel
… booting up chrome (latest) on Windows 8.1

Error: The environment you requested was unavailable.
    at /Users/zeke/.nvm/v0.10.25/lib/node_modules/browser-repl/node_modules/wd/lib/webdriver.js:360:15
    at Request._callback (/Users/zeke/.nvm/v0.10.25/lib/node_modules/browser-repl/node_modules/wd/lib/webdriver.js:281:7)
    at Request.self.callback (/Users/zeke/.nvm/v0.10.25/lib/node_modules/browser-repl/node_modules/wd/node_modules/request/request.js:122:22)
    at Request.EventEmitter.emit (events.js:98:17)
    at Request.<anonymous> (/Users/zeke/.nvm/v0.10.25/lib/node_modules/browser-repl/node_modules/wd/node_modules/request/request.js:888:14)
    at Request.EventEmitter.emit (events.js:117:20)
    at IncomingMessage.<anonymous> (/Users/zeke/.nvm/v0.10.25/lib/node_modules/browser-repl/node_modules/wd/node_modules/request/request.js:839:12)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:920:16
    at process._tickCallback (node.js:415:13)

Error response status: 13 after connect with ie6

I get the error below consistently. With ie9 I just get "socket disconnected". Both these messages appear after a sizeable delay. Chrome and Firefox seem to work fine.

$ SAUCE_USERNAME=XXX SAUCE_ACCESS_KEY=XXX repl ie6
… setting up tunnel
… booting up internet explorer (6) on Windows XP
… ready!
ie6 › window

Error: Error response status: 13. 
    at Webdriver._newError (/usr/lib/node_modules/browser-repl/node_modules/wd/lib/webdriver.js:80:13)
    at /usr/lib/node_modules/browser-repl/node_modules/wd/lib/webdriver.js:156:25
    at /usr/lib/node_modules/browser-repl/node_modules/wd/lib/webdriver.js:411:5
    at Request._callback (/usr/lib/node_modules/browser-repl/node_modules/wd/lib/webdriver.js:281:7)
    at Request.self.callback (/usr/lib/node_modules/browser-repl/node_modules/wd/node_modules/request/request.js:122:22)
    at Request.EventEmitter.emit (events.js:98:17)
    at Request.<anonymous> (/usr/lib/node_modules/browser-repl/node_modules/wd/node_modules/request/request.js:888:14)
    at Request.EventEmitter.emit (events.js:117:20)
    at IncomingMessage.<anonymous> (/usr/lib/node_modules/browser-repl/node_modules/wd/node_modules/request/request.js:839:12)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)

Double prompt

Been hitting this situation recently:
image

Two prompt()s are initiated, connected to the same client.
Not sure of the root cause, but we're getting two "connection" events inbound sometimes.

This may be a side-effect of the deps bumps I did. :/

Meanwhile, I've noticed that the vm.get callback sometimes starts much later than the socket's "connection" event. I moved start() into that callback in 3b834cb but I think it's a race condition either way.

To me, feels like the fix to both is only starting the prompt once both wd and the socket are ready

Hows that sound?

Error: Cannot find module 'socket.io-client/socket.io.js'

Hi! I have error when try run repl ie6

Do all how described in instruction.

 node --version
v0.10.13
npm --version
1.3.2
uname -srmv
Linux 3.8.0-33-generic #48-Ubuntu SMP Wed Oct 23 09:16:58 UTC 2013 x86_64
repl ie6

module.js:340
    throw err;
          ^
Error: Cannot find module 'socket.io-client/socket.io.js'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.require.resolve (module.js:384:19)
    at Object.<anonymous> (/home/maksimrv/.nvm/v0.10.13/lib/node_modules/browser-repl/node_modules/socket.io/lib/index.js:27:33)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/maksimrv/.nvm/v0.10.13/lib/node_modules/browser-repl/node_modules/socket.io/index.js:2:18)

node_modules/socket.io-client

{
  "name": "socket.io-client",
  "description": "Socket.IO client for the browser and node.js",
  "version": "0.9.16",
  "main": "./lib/io.js",
...
}

We try find module 'socket.io-client/socket.io.js'.

*dist director contain socket.io.js

/.nvm/v0.10.13/lib/node_modules/socket.io-client/dist git:(master) ls
socket.io.js  socket.io.min.js  WebSocketMainInsecure.swf  WebSocketMain.swf

lib directory doesn't contain socket.io.js

~/.nvm/v0.10.13/lib/node_modules/socket.io-client/lib git:(master) ls
events.js  io.js  json.js  namespace.js  parser.js  socket.js  transport.js  transports  util.js  vendor

IE10-11 are not showing non-enumerable properties

… booting up internet explorer (11) on Windows 8.1
… ready!
ie11 › window
{ options: { _: [ 'ie11' ] },
  console: 
   { log: [Function],
     info: [Function],
     warn: [Function],
     error: [Function],
     debug: [Function] },
  _: [Circular] }

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.