Why does editing javascript in Chrome Developer Tools not work?

9

1

I have Google Chrome 13.0.782.220 on my Ubuntu 10.04 LTS (64-bit).

I try to edit a JavaScript code from an external JS file in the Chrome Developer Tools Scripts pane by double-clicking on the script area. No matter how fast I click, the only effect is to select a nearby word.

Does anybody have an idea why the edit mode isn't activated?

Rajish

Posted 2011-09-13T10:15:09.633

Reputation: 570

I don't think there is a Javascript edit mode in Webkit Inspector. At best, you could use breakpoints, and trace your output. – Nemo – 2011-09-15T12:30:47.070

As stated here (redirected from here it is possible.

– Rajish – 2011-09-15T12:36:22.273

1

This comment states that "Unfortunately you cannot live-edit pretty-printed JS. Maybe that'll come later."

Dated 16th May 2011, so its pretty recent

– Nemo – 2011-09-15T12:39:41.160

Yes, it does work with pretty print off. Chrome is awesome – Nemo – 2011-09-15T12:40:47.727

@Capt.Nemo You hit the nail. Put it as the answer so I could award you with the bounty. – Rajish – 2011-09-18T19:28:04.040

Answers

20

Chrome Webkit Inspector does not allow you to live-edit pretty printed Javascript. Click the pretty print button (Looks like { }) in the Scripts tab to disable pretty-print mode and edit it.

Source: Introduction To Chrome Developer Tools

Nemo

Posted 2011-09-13T10:15:09.633

Reputation: 1 126

2

You might have hit against the Same origin policy.

From Disabling cross-domain security check for AJAX development in Google Chrome :

Start Google Chrome from command line, Ubuntu/Linux:

chromium-browser --disable-web-security

harrymc

Posted 2011-09-13T10:15:09.633

Reputation: 306 093

0

It's a bug. You can simulate a solution by pasting the formatted code into the minified file.

wcr4

Posted 2011-09-13T10:15:09.633

Reputation: 21

1feel free to tell me why you downvoted – wcr4 – 2016-04-08T20:40:07.930