Closed outaTiME closed 9 years ago
thanks, I can reproduce it. I was using undocumented repl.prompt()
and it seems that API has changed
iojs and 0.12 only - 0.10 does not give error. On it
+1
hm, I thought I fixed this
same fix should apply here. I'll try to fix tomorrow unless you can try before me @outaTiME @fakedrake
published as v1.0.0
Hi pal,
Now it works but i get a new error, here the stack:
$ crconsole
http://localhost:9000/desktop/dashboard.html
url.js:110
throw new TypeError("Parameter 'url' must be a string, not " + typeof url)
^
TypeError: Parameter 'url' must be a string, not undefined
at Url.parse (url.js:110:11)
at Object.urlParse [as parse] (url.js:104:5)
at WebSocket.initAsClient (/usr/local/lib/node_modules/crconsole/node_modules/chrome-remote-interface/node_modules/ws/lib/WebSocket.js:475:23)
at new WebSocket (/usr/local/lib/node_modules/crconsole/node_modules/chrome-remote-interface/node_modules/ws/lib/WebSocket.js:59:18)
at Chrome.connectToWebSocket (/usr/local/lib/node_modules/crconsole/node_modules/chrome-remote-interface/lib/chrome.js:131:15)
at Object.ChromeREPL.setTab (/usr/local/lib/node_modules/crconsole/index.js:236:17)
at Object.<anonymous> (/usr/local/lib/node_modules/crconsole/index.js:23:12)
at /usr/local/lib/node_modules/crconsole/index.js:172:7
at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/crconsole/node_modules/chrome-remote-interface/lib/chrome.js:123:13)
at IncomingMessage.emit (events.js:129:20)
something wired, here nooup ??
thks !!
can't reproduce. What is your chrome version?
Could you add console.log(tab)
before https://github.com/sidorares/crconsole/blob/master/index.js#L236 ? For some reason webSocketDebuggerUrl
property is not set for you
Hi pal, there my chrome version:
i could try, give me few minutes ...
yay, im clone the repo and running locally ...
the '>>>' are console.log('>>>', tab);
in:
https://github.com/sidorares/crconsole/blob/master/index.js#L236
here the trace:
[0] chrome-devtools://devtools/bundled/devtools.html?&can_dock=true&dockSide=undocked&toolbarColor=rgba(230,230,230,1)&textColor=rgba(0,0,0,1)
[1] chrome-devtools://devtools/bundled/toolbox.html?&can_dock=true&dockSide=undocked&toolbarColor=rgba(230,230,230,1)&textColor=rgba(0,0,0,1)
[2] http://localhost:9000/desktop/dashboard.html
[3] https://github.com/sidorares/crconsole
[4] chrome-extension://pafkbggdmjlpgkdkcbjmhmfcdpncadgh/_generated_background_page.html
[5] chrome-extension://onhbegdkgonhlokobjefolhpoidcnida/background.html
[6] chrome-extension://jnihajbhpnppcggbcgedagnkighmdlei/_generated_background_page.html
[7] chrome-extension://gmlllbghnfkpflemihljekbapjopfjik/_generated_background_page.html
[8] chrome-extension://cjpalhdlnbpafiamejdnhcphjbkeiagm/background.html
[9] chrome-extension://chklaanhfefbnpoihckbnefhakgolnmc/_generated_background_page.html
[10] chrome-extension://aomjjhallfgjeglblehebfpbcfeobpgk/_generated_background_page.html
[11] https://docs.google.com/offline/backgroundshell#ouid=u1b9d54c15874ee64
[12] https://docs.google.com/fe/s/fe.s.ClientModule.nocache.js?ouid=u1b9d54c15874ee64
localhost> .switch 2
>>> { description: '',
faviconUrl: 'http://localhost:9000/skyweb/assets/images/favicon.png?_swc=1430320877323',
id: '79F92A9E-09A4-4D42-AECA-8175874B4C7A',
title: 'Dashboard',
type: 'page',
url: 'http://localhost:9000/desktop/dashboard.html' }
url.js:110
throw new TypeError("Parameter 'url' must be a string, not " + typeof url)
^
TypeError: Parameter 'url' must be a string, not undefined
at Url.parse (url.js:110:11)
at Object.urlParse [as parse] (url.js:104:5)
at WebSocket.initAsClient (/Users/outaTiME/Code/crconsole/node_modules/chrome-remote-interface/node_modules/ws/lib/WebSocket.js:475:23)
at new WebSocket (/Users/outaTiME/Code/crconsole/node_modules/chrome-remote-interface/node_modules/ws/lib/WebSocket.js:59:18)
at Chrome.connectToWebSocket (/Users/outaTiME/Code/crconsole/node_modules/chrome-remote-interface/lib/chrome.js:131:15)
at Object.ChromeREPL.setTab (/Users/outaTiME/Code/crconsole/index.js:237:17)
at Object.<anonymous> (/Users/outaTiME/Code/crconsole/index.js:359:14)
at IncomingMessage.<anonymous> (/Users/outaTiME/Code/crconsole/node_modules/chrome-remote-interface/lib/chrome.js:123:13)
at IncomingMessage.emit (events.js:129:20)
at _stream_readable.js:908:16
ok, I think I know what is the problem. You already have devtools open and chrome does not allow to connect external client ( that's why your tab is missing webSocketDebuggerUrl
). Close devtools and try again
Probably need to add better error handling for this
mmm, but i like to display the output in developer tools in crconsole, its not possible ??
you can try to use https://github.com/sidorares/crmux
mmm, i trying crmux ... but i want to display the developer tools output in my terminal not in a remote window it could be possible ??
Which output? console messages are redirected back to terminal, you should be able to see them
with the crmux
??
There is my scenario:
Which is the step by step to perform this ?? maybe i doing something wrong ...
thks!
no, you don't need crmux. Just attach crconsole (make sure there is no devtools attached ) messages should automatically appear in your crconsole session. No extra steps required
mmmm, but only displays the console.log
not all messages right ???
i got a lot of console.info
and these data not shown =( it possible ??
the console output not are really identically =(
You are right, it's ignored - the code is here https://github.com/sidorares/crconsole/blob/master/index.js#L250
ooups, some reason for that ?? our it will be updated ??
not sure, probably no reason. Can you try to disable filtering? Just comment out https://github.com/sidorares/crconsole/blob/master/index.js#L250-L251
jejeje, great ... i try to update the code locally and try ...
i give you my feedback if found any side effect ^^
thks !
probably would be nice to display logs in different color based on the level
yup, probably it will very usefull ... BTW if i comment the filtering all goes fine ... no exceptions ^^
but expressions in logs are not resolved =(
like:
[Platform.Desktop.Modules.Dashboard] Incoming message: %s record(s) updated in: %sms
Some limitation in Chrome REPL ??
can you post exactly your code which outputs log? Whith console.log('test')
or console.info('test')
I can see messages ( filtering is commented out )
The simple logging works, but if you put something like:
console.log('Today is: %s', new Date())
the crconsole
displays:
'Today is: %s'
without the replacement, it understands ??
yes, but you'll need to process parameters manually. Uncomment https://github.com/sidorares/crconsole/blob/master/index.js#L248 to see payload, it's in message.parameters
added #13 to track progress
Hi pal,
When i run the comman i get the following error: