Javascript console not working if Google Chrome is started from OS X terminal

3,132 views
Skip to first unread message

giovanni...@deepsky.it

unread,
Nov 1, 2016, 4:31:08 PM11/1/16
to Google Chrome Developer Tools

I need to launch Google Chrome on OS X with the --allow-file-access-from-files option (to work locally with d3.js). To do this, I start Chrome from the terminal, as follows:

open /Applications/Google\ Chrome.app --args --allow-file-access-from-files


However, it seems that this prevents the javascript console from working correctly. console.log() does not print anything anymore. I suppose the output is redirected elsewhere when Chrome is started this way.


Is there a way to launch Chrome with options on OS X and still have the console working as usual?

PhistucK

unread,
Nov 1, 2016, 4:36:33 PM11/1/16
to Google Chrome Developer Tools
https://www.chromium.org/developers/how-tos/run-chromium-with-flags shows a way to run Chrome with command line flags, perhaps that way will work better.


PhistucK

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-developer-tools+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/ab61dbab-db72-4769-bfa1-3816ba9161a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

giovanni...@deepsky.it

unread,
Nov 1, 2016, 6:05:45 PM11/1/16
to Google Chrome Developer Tools


Il giorno martedì 1 novembre 2016 21:36:33 UTC+1, PhistucK ha scritto:
https://www.chromium.org/developers/how-tos/run-chromium-with-flags shows a way to run Chrome with command line flags, perhaps that way will work better.


 No, same result. Even if I run Chrome this way, console.log() still stops working.

Erik Luo

unread,
Nov 1, 2016, 8:26:05 PM11/1/16
to Google Chrome Developer Tools
Thanks for reporting.  Phistuck's link shows the correct way to launch with flags.

I wasn't able to reproduce this on my computer with "/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --allow-file-access-from-files".  Could you give us some more details about your setup?  Being able to reproduce what you're seeing is important for us to work on this.

Some things to try:
Where should the console.log's coming from?  Does anything evaluate in your console when you type?  Perhaps console.log is being overwritten somewhere?  Does the rest of DevTools (debugging, inspecting) still work?  Have you tried disabling Chrome extensions / tried on a fresh profile?

If none of those fix it, could you please file a bug in our tracking system?  Thanks!

giovanni...@deepsky.it

unread,
Nov 2, 2016, 7:07:46 AM11/2/16
to Google Chrome Developer Tools


I am using Chrome 54.0.2840.67 (64-bit), freshly installed without any customization, on OS X 10.11.6.

What happens is this:
1. If I launch Chrome from the finder, everything is good. Entering console.log("hello") in the console produces, as expected, the string "hello" and an undefined return value.
2. However, if Chrome is launched from the OS X terminal (even without any command line option), the same does not happen. Entering console.log("hello") produces no visible result, just the undefined return value. Also, the inspector seems not to work very well. CSS styles are not displayed anymore, for example.

Not sure if it is relevant, but in the latter case I also see a long sequence of identical messages in the terminal, like this one:

[834:1295:1102/115447:ERROR:CONSOLE(1557)] "SyntaxError: Unexpected number in JSON at position 83 SyntaxError: Unexpected number in JSON at position 83
    at JSON.parse (<anonymous>)
    at WebInspector.ServiceWorkerConnection.dispatch (chrome-devtools://devtools/bundled/inspector.js:4413:154)
    at WebInspector.ServiceWorkerManager._dispatchMessage (chrome-devtools://devtools/bundled/inspector.js:6090:20)
    at WebInspector.ServiceWorkerDispatcher.dispatchMessage (chrome-devtools://devtools/bundled/inspector.js:6130:16)
    at Object.dispatch (chrome-devtools://devtools/bundled/inspector.js:4478:63)
    at WebInspector.MainConnection.dispatch (chrome-devtools://devtools/bundled/inspector.js:4418:31)
    at WebInspector.MainConnection._dispatchMessage (chrome-devtools://devtools/bundled/inspector.js:10591:7)
    at WebInspector.Object.dispatchEventToListeners (chrome-devtools://devtools/bundled/inspector.js:738:185)
    at innerDispatch (chrome-devtools://devtools/bundled/inspector.js:1557:58)
    at InspectorFrontendAPIImpl._dispatch (chrome-devtools://devtools/bundled/inspector.js:1556:1)", source: chrome-devtools://devtools/bundled/inspector.js (1557)

Blaise Bruer

unread,
Nov 2, 2016, 12:49:31 PM11/2/16
to Google Chrome Developer Tools
If you run Chrome beta or Chrome dev or Canary does the same thing happen?

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/0b079bb3-3feb-4437-b171-ab41d1fc084e%40googlegroups.com.

Dima Yakovenko

unread,
Nov 2, 2016, 4:32:04 PM11/2/16
to Google Chrome Developer Tools
I have the same problem. With Canary everything is ok.

среда, 2 ноября 2016 г., 18:49:31 UTC+2 пользователь Blaise Bruer написал:
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-developer-tools+unsub...@googlegroups.com.

Alexey Kozyatinskiy

unread,
Nov 3, 2016, 5:46:07 PM11/3/16
to Google Chrome Developer Tools
Please take a look into https://bugs.chromium.org/p/chromedriver/issues/detail?id=1552#c38.
Comment #38 and #43 describe different solutions.
This issue is fixed in Beta channel and Canary.

Thanks you,
Aleksey.
Reply all
Reply to author
Forward
0 new messages