Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added live editing

  • Loading branch information...
commit 10988bcf928a018bc9659a31a6c0b6dd393649c2 1 parent dd3e8fd
@dannycoates dannycoates authored
View
8 front-end/node/Debugger.js
@@ -153,6 +153,14 @@ WebInspector.nodeDebugger = (function() {
},
stopProfiling: function() {
sendRequest('profile', {arguments: {command: 'pause', modules: 1, tag: 0}});
+ },
+ liveEdit: function(callId, sourceID, newContext) {
+ var args = {
+ script_id: sourceID,
+ preview_only: false,
+ new_source: newContext
+ };
+ sendRequest('changelive', {arguments: args}, {id: callId, body: newContext});
}
};
View
8 front-end/node/InspectorBackendStub.js
@@ -206,9 +206,9 @@ WebInspector.InspectorBackendStub.prototype = {
WebInspector.updatePauseOnExceptionsState(value);
},
- editScriptSource: function()
+ editScriptSource: function(callId, sourceID, newContext)
{
- WebInspector.didEditScriptSource(callId, false);
+ WebInspector.nodeDebugger.liveEdit(callId, sourceID, newContext);
},
getScriptSource: function(callId, sourceID)
@@ -282,11 +282,9 @@ WebInspector.InspectorBackendStub.prototype = {
saveSessionSettings: function()
{
},
-
-
+
dispatchOnInjectedScript: function()
{
- console.log("injected: " + JSON.stringify(arguments));
switch(arguments[2]) {
case 'getProperties':
var id = arguments[1];
View
10 front-end/node/InspectorFrontendHostStub.js
@@ -211,6 +211,9 @@ WebInspector.InspectorFrontendHostStub = function()
panel._clearInterface();
}
});
+ debugr.on('changelive', function(msg) {
+ WebInspector.didEditScriptSource(msg.callId.id, msg.success, msg.message ||msg.callId.body);
+ });
debugr.on('frame', function(msg) {
});
@@ -306,6 +309,11 @@ WebInspector.InspectorFrontendHostStub.prototype = {
loaded: function()
{
+ Preferences.samplingCPUProfiler = true;
+ Preferences.heapProfilerPresent = true;
+ Preferences.debuggerAlwaysEnabled = true;
+ Preferences.profilerAlwaysEnabled = true;
+ Preferences.canEditScriptSource = true;
document.getElementById("dock-status-bar-item").style.display='none';
WebInspector.populateApplicationSettings();
WebInspector.applicationSettings.installSetting("scriptsSidebarWidth", "scripts-sidebar-width", 250);
@@ -322,7 +330,7 @@ WebInspector.InspectorFrontendHostStub.prototype = {
hiddenPanels: function()
{
- return "elements,resources,timeline,profiles,storage,audits";
+ return "elements,resources,timeline,storage,audits";
},
inspectedURLChanged: function(url)
View
6 readme.md
@@ -5,7 +5,7 @@ Node Inspector is a debugger interface for nodeJS using the WebKit Web Inspector
### Requirements
* [nodeJS](http://github.com/ry/node)
- - versions: 0.1.100 - 0.1.101
+ - versions: 0.1.100 or later
* A WebKit based browser: Chrome, Safari, OmniWeb, etc.
### Setup
@@ -25,11 +25,11 @@ As an example lets debug test/hello.js, from the root project directory (node-in
1. start the inspector like this:
node bin/inspector.js --start=test/hello.js
-> Note: --start path must be relative to the current working directory or absolute
+ > Note: --start path must be relative to the current working directory or absolute
2. open http://127.0.0.1:8080 in your favorite WebKit based browser
-> Chrome 5 users **MUST** use 127.0.0.1 **NOT** localhost or the browser will not connect to the debugger
+ > Chrome 5 users **MUST** use 127.0.0.1 **NOT** localhost or the browser will not connect to the debugger
3. you should now see the javascript source from nodeJS

1 comment on commit 10988bc

@frank06

cool, can't wait to try this out!

Please sign in to comment.
Something went wrong with that request. Please try again.