Code Monkey home page Code Monkey logo

jsconsole's Introduction

jsconsole(2)

jsconsole's People

Contributors

brianarn avatar cheeaun avatar dahlbyk avatar daniel-hug avatar gilbert avatar happygiraffe avatar jwallin avatar mathiasbynens avatar mbeijen avatar remy avatar rgrove avatar richienb avatar webpro avatar willj 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

jsconsole's Issues

2 minutes delay...

Hello,

I have to wait about 2 minutes before to see the console populated ? This is a normal duration ? by looking the video, i can see that the result is almost immediat. However my network connection is fast.... any explanation?

Regards,
Johnny

Shift + up/down does not work in Chrome 11

Shift + up/down shortcut does not work in my portable version of Chrome 11.0.696.65 as well as Chrome 12 Beta.

Although it works without any issues in Portable Firefox 4.0 and Internet Explorer 8.

Wrong :listen script when running local set up

When I run jsconsole locally, using node server.js 8080, and the command :listen should produce the script url as

<script src="http://MYIP:8080/remote.js?UNIQUEID"></script>

But it is pointing to http://jsconsole.com/remote.js. Copy pasting the script link is not possible because of this.

findElement

_get = function(e,c){
var _isClass,_isId,newEle;
typeof e=="string"&&(_isClass = e.indexOf(".")>=0,_isId = e.indexOf("#")>=0,newEle = e.substring(1));
//get frist argument
if(_isClass&&_isId) return;
if(_isId){
var obj = typeof newEle=="string"?document.getElementById(newEle):false;
}else if(_isClass){
var obj = _class(newEle),
_isArr = obj.constructor==Array;
}else{
return;
}
//get class
function _class(c,o){
var oDom = o?o:document,
cParent = oDom.getElementsByTagName("*"),
classAry = [],
leng = cParent.length;
for(var i=0;i<leng;i++){
var allC = cParent[i].className,
word = allC.split(" ");
for(var z=0,len=word.length;z<len;z++){
word[z]==c&&classAry.push(cParent[i])
}
}
return classAry.length==1?classAry[0]:classAry;
}
//second argument
if(!!c){
if(_isArr){
for(var j=0,len=obj.length;j<len;j++){
var ele = obj[j].getElementsByTagName(c);
obj[j] = ele.length==1?ele[0]:ele;
}
}else{
obj = obj.getElementsByTagName(c);
}
}
if(obj)return obj.length==1?obj[0]:obj;
}

TODO: help

User types:

:help

Gets a response in the console with keyboard shortcuts, shift+up/down, meta+shift+del, etc.

IE7 does not support AddEventListener

When you are trying to use jsconsole in IE7 it does not support addEventListener. You get the following exception:

Object doesn't support property or method 'addEventListener'

https://jsconsole.com get a net::ERR_CONNECTION_CLOSED

Hello,

as first i must say is a very nice tool, i have test it for few weeks.
But now i will debug again and it work not more :(

i get this errors on my browser:

GET https://jsconsole.com/remote/5d3bcc15-a686-4250-bd87-cc1d8e09777f/run net::ERR_CONNECTION_CLOSED
https://jsconsole.com/remote/5d3bcc15-a686-4250-bd87-cc1d8e09777f/log Failed to load resource: net::ERR_CONNECTION_CLOSED

i hope you can fix or help.

Best regards,
Stefan

license + pledgie

I want to make a fork of this. I noticed on the jsbin repo, you have a license specified and pledgie. I'd love to see both on this repo. Thanks!

IE crashes on Windows Mobile 6

The remote script is breaking the Internet Explorer on old Windows Mobile devices. I tested it on the "HTC Touch Diamond 2" and the "Windows Mobile 6.5 Emulator". IE is crashing with error 80004004 - whatever that means...
I really don't think you should care, but I wanted to let you know.

Multiple domain support

@remy was kind enough to share a temporary URL to support SSL.
jsconsole doesn't seem ready for it as it tries to load content over http once it fires in the running app.
Chrome will output an error like this when it happens:
[blocked] The page at 'https://foobar.com' was loaded over HTTPS, but ran insecure content from 'http://remote.html/?BD7C07A2-C379-4D43-B34B-33C9C0825E37': this content should also be loaded over HTTPS.

remote sessions

Tried to install it by cloning this repository, running npm install and then the node server.js.

The page loads up, and I can get a key but when including the script in a remote page it never seems to connect to the server. I can see in the network tabs that both the dashboard and the remote page are connected to port 8000. When I debug it seems that both pages get a 'session' with the same id and they overwrite each other.

I am using chrome though I doubt it will matter.

quit putting quotes around outputted strings

Migrated from: jsbin/jsbin#2086 (comment)

IMO the console should quit putting quotes around strings similar to how Firefox's devtools do and follow Chrome's example. Putting quotes around outputted strings is misleading as users could take them to be string literals when they're not.

Here's an example where Chrome's quote free method shines:

'as\\"df'  // console input
"as\"df"   // Firefox output | The value changes when evaluated as a string literal: as"df
"as\\"df"  // jsconsole output (evaluated as a string literal this throws a syntax error)
as\"df     // Chrome output

outputted script tag points to jsconsole.com when hosting jsconsole locally

When running jsconsole from the downloaded source. the script tag that gets spit out always points to jsconsole.com when starting a listener.

Can this be changed to wherever it's being accessed from?

For instance: when running
node server.js 1337
to get
localhost:1337/?%3Alisten

<script src="http://localhost:1337/remote.js?SOME-LONG-RANDOM-ID"></script>

Thanks!

Paths for external library shorcuts are out of date

:load underscore

results in:

Failed to load http://documentcloud.github.com/underscore/underscore-min.js

The following libraries are also out of date:

rightjs: Failed to load http://rightjs.org/hotlink/right.js
coffeescript: Failed to load http://jashkenas.github.com/coffee-script/extras/coffee-script.js

Handling Click events on Mobile Browsers

I am trying to click certain list elements on my mobile website and proceed to the next page.

$('#id').click() . The function works perfectly fine when I try it on my web browser however some how its not working on mobile Browsers.

I have been able to fill fields , change CSS etc . I am stuck on this . Any ideas?

Thanks
BTW i think this tool has great potential .

Console output is not escaped

Any console.log methods output to the jsconsole. However, this is not escaped, so console.log(document.body.innerHTML) does not show the HTML of the document in jsconsole, but puts that HTML into the jsconsole page.

console.log("<script>alert('hi');</script>"); would make an alert happen on the jsconsole.com page as well. I'm not sure if XSS is a problem here, but it still makes it difficult to use console.log with html text.

Uncaught RangeError: Maximum call stack size exceeded

I'm trying to fix a weird bug that appear just in the facebook in-app browser, and jsconsole is very handy in this situation. Basically after a successfull :listen i trigger a function onClick where i put a logger on the suspicious piece of code, and what i get back is:

image

That as you can imagine is not very helpful. Looking deeper, (not 100% this is related) i see this in my console:
Uncaught RangeError: Maximum call stack size exceeded. remote?myID:30

Can be something related to the bug i'm facing, so something that belongs to my implementation or is related to jsconsole remote.js itself?

/cc @remy

Thank you
Stefano

Enhancement: dynamically generate ID in remote.js and expose to client

I forked the repo to allow the ID that you can listen on to be dynamically generated in remote.js and then shared with the client as both a string and as a QR code that points to the URL that can be used to launch the console. So tha I don't submit an unsolicited PR, is this something you'd be interested in merging?

Here is a screenshot of how this can be used:

image
image

Feature Request - "Support Workflow"

In order to use jsconsole for providing support, It would usefull to have this workfow:

  1. Client generates a random key
  2. Client establishes connection with the server using this key (.../remote.js?$key)
  3. Server accepts the connection (server should start listening without executing :listen $key)
  4. User provides the $key to the support team
  5. Support team accesses the client-device by providing the key (:listen $key or :connect $key if you want to give it other name)

Basically, this is the way how teamviewer and other products work (it's easier to read the key from device and give it to support, than having support giving you the key and having to enter it).

BTW, on the client, you can generate a numeric random key with:

var supportPassword = GenerateRandomString(6, '0123456789');

function GenerateRandomString(length, chars) {
    var result = '';
    for (var i = length; i > 0; --i) result += chars[Math.round(Math.random() * (chars.length - 1))];
    return result;
}

and then activate the connection with:

(function(s){s.src='http://imatronix.com:60701/remote.js?' + supportPassword;document.body.appendChild(s)})(document.createElement('script'));

The problem is that you need to wait that support executes the :listen command with the key, before activating the connection on the client device.

This could be done with an alert("Please wait...") before trying to activate the connection.

If you could do something to detect a connection failure (because support didn't :listen yet) and retry, it would be usefull to.

FR : Tab completion ?

Would be nice to have :lo<tab> must complete to :load ?

/me is not able to recall, if this was there on jsconsole before ๐Ÿ‘ด

Error: listen EACCESS

i clone jsconsole, and just run server.js , which give me errors below:

geimatoMacBook-Air:neekey-jsconsole-2ad9248 neekey$ node server.js
Listening on 80

node.js:207
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: listen EACCESS
at errnoException (net_uv.js:566:11)
at Array. (net_uv.js:632:26)
at EventEmitter._tickCallback (node.js:199:26)

any idea?

add server.js

'use strict';
const fs = require('fs');
process.env.PORT = process.argv[2] || 8000;
fs.readFile('lib/app.js', (err, data) => {
    if (err) throw err;
    if (data.indexOf('"use strict"') !== 0) {
        fs.writeFileSync('lib/app.js', '"use strict";\n' + data);
    }
    require('./lib/app');
    setTimeout(function() {
        let address = 'http://127.0.0.1:' + process.env.PORT;
        require('child_process').exec('start ' + address);
        console.log('start browser at ' + address);
    });
});

:listen doesn't connect

Hi, sorry to trouble you,

I followed the video on youtube but when I type ":listen" to get the id, it says: "Creating Connection" but that's it. I never get to see the next message with the Id.

I tried firefox 4, safari and chrome. I suppose is some feature in my windows 7 that is wrong? Or does it works only on OSX?

:listen doesn't connect #2

When performing a remote listen I encounter some strange behavior. At first it seemed like it does not connect at all. Then I realized the communication is very, very slow. It takes about 2 minutes until the message "Connected to xxxxxxxxxx" appears. Each log from the remote page again takes minutes to appear in the console in a random order.

This happens in different browsers: Opera, Firefox, Chrome. I don't know how to replicate it. At my workmate's computer it works just fine.

html on harddisk does not connect correctly

[Error] Failed to load resource: The requested URL was not found on this server. (remote.html, line 0):

file:///remote.html?e6916321-8659-4720-a028-1114d9eb2bce

There should probably be a check if the file is on file://

Session support

What do you mean exactly by "Permalink to session"?

A session persistant across different browsers/computers or... a session persistent through page reloading / tab duplication / etc. ?

For the later, you could use WebStorage / WebSQL API in browsers that support them to allow sessions to be saved.

error event not passing through info in firefox

Here's an interesting quirk I found. You've attached the error event using addEventListener in your remote.js script but when an error occurs all the arguments are undefined, but only in firefox.

I did some testing and found attaching the event using DOM0 event handler works and passes through the information.

See DOM0 example here (click the result panel to trigger an error): http://jsfiddle.net/ryanseddon/3Nm5x/11/

See DOM2 event handler here: http://jsfiddle.net/ryanseddon/3Nm5x/10/

TODO: investigate possibility of autocomplete

Ala Webkit console.

Switch to using a div, -webkit-user-modify prop for cursor - Q: anything like this for other browsers? Perhaps PE? Perhaps contenteditable?

Read keys when focused creating index of objects that match the string being entered. Need to re-read all objects on global space after new code is submitted (in case they create new variables).

Tab and escape autocompletes.

When the user hits a dot, navigate down that object and offer nested objects for autocomplete. Don't preview function calls though (I think Webkit /is/ doing this).

where is the 'server.js' ?

I've install the package,and then there's not a file named server.js.How could I run the server locally ?

$ node server.js 8888
module.js:340
throw err;
^

Error: Cannot find module 'D:\cc\jsconsole\jsconsole-master\server.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:289:25)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:136:18)
at node.js:963:3

Connection not being created using :listen

This was working fine earlier, but now on running :listen in jsconsole prompt, no connection is created at all (tried in chrome / ff / safari).

The remote callback seems to be in a waiting state, and the remote log is still pending after minutes and hours, i.e., doesn't ever complete.

Any clues ? I love this tool, and would be a shame to not have it working.

Firefox history pushState error.

I needed jsconsole for testing on Android and it's perfect. Love it.

I very nearly wrote it off as non-functional, however, as the inject script in the latest Firefox (10.0.2) returned this error:

Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMHistory.pushState]
[Break On This Error]   

window.history.pushState(cmd, cmd, '?' + encodeURIComponent(cmd));

Confirmed this on Ubuntu and Windows. Not sure why it would disallow that but a simple try/catch block may be in order. The main site works fine.

Pressing up arrow to get previous line converts < to &lt;

Small bug I just noticed:

  1. Type x = '<' and press enter
  2. Press the up arrow

actual result: x = '&lt' appears
expected result: x = '<' appears

Haven't tested, but I expect > and & produce similar output. I haven't looked at the jsconsole code at all, but I wouldn't mind helping fix this, especially if I got a hint of how to do it.

Setting up reverse proxy

I created a new application under Default Web Site in my IIS. I had setup reverseproxy Any requests made to this application will be redirected to jsconsole running on my local at port 8080. Anyone able to do this?

iOS 4.3 error

When performing a remote listen I'm getting the following error on Mobile Safari (iOS 4.3) when I include console.js - here's the error in full (limited due to a rubbish developer tool in the browser):

Javascript Error on Line 564
TypeError: Result of expression 'exec' [null] is not an object.

That's probably useless, but I imagine the issue is easy to replicate..

console.error, warn and info?

Maybe it's just me, but it seems that this only works for console.log, and not for the other methods. Can those be added?

Does prettify.unpacked.js exist anywhere?

I'm probably missing something obvious, but: when you type e.g. window into http://jsconsole.com, you get a sweet pretty-printed representation. Near as a I can tell this is implemented in the public/js/prettify.packed.js TLOB; is the unminified source code available?

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.