diff --git a/ChangeLog b/ChangeLog index 1b4babb..aae4ec5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +v0.1.1 + +* Fixed pause button with node 0.3.1+ + +* Fixed page refresh with node 0.3.1+ + +* Shortened script file names in script list + +* Updated node-websocket-server library + + v0.1.0 * Require node 0.3+ diff --git a/bin/inspector.js b/bin/inspector.js index 761d764..fe02f49 100755 --- a/bin/inspector.js +++ b/bin/inspector.js @@ -1,6 +1,8 @@ #!/usr/bin/env node var dserver = require('../lib/debug-server'), + fs = require('fs'), + path = require('path'), options = {}; process.argv.forEach(function (arg) { @@ -27,7 +29,16 @@ process.argv.forEach(function (arg) { } }); -dserver.create(options).on('close', function () { - console.log('session closed'); - process.exit(); +fs.readFile(path.join(__dirname, '../config.json'), function(err, data) { + var config; + if (err) { + config = {}; + } + else { + config = JSON.parse(data); + } + dserver.create(options, config).on('close', function () { + console.log('session closed'); + process.exit(); + }); }); diff --git a/config.json b/config.json new file mode 100644 index 0000000..61c9a99 --- /dev/null +++ b/config.json @@ -0,0 +1,16 @@ +{ + "hidden": [ + "buffer.js", + "dns.js", + "events.js", + "freelist.js", + "fs.js", + "http.js", + "net.js", + "node.js", + "path.js", + "stream.js", + "timers.js", + "util.js" + ] +} \ No newline at end of file diff --git a/lib/debug-server.js b/lib/debug-server.js index 072d6cf..46356f6 100644 --- a/lib/debug-server.js +++ b/lib/debug-server.js @@ -19,7 +19,7 @@ function override(options, defaults) { return result; } -exports.create = function(options) { +exports.create = function(options, config) { var defaults = { webPort: 8080 }, settings = override(options || {}, defaults), httpServer = Http.createServer(staticFile), @@ -27,7 +27,7 @@ exports.create = function(options) { wsServer.on('connection', function (conn) { var port = parseInt((/\?port=(\d+)/.exec(conn._req.url) || [null,'5858'])[1], 10), - session = Session.create(conn, port); + session = Session.create(conn, port, config); conn.on('message', function (data) { session.handleRequest(data); diff --git a/lib/session.js b/lib/session.js index 5e2c72c..a9ebeaa 100644 --- a/lib/session.js +++ b/lib/session.js @@ -6,7 +6,7 @@ var http = require('http'), /////////////////////////////////////////////////////////// // exports -exports.create = function (conn, debuggerPort) { +exports.create = function (conn, debuggerPort, config) { var debug = null, //map from sourceID:lineNumber to breakpoint breakpoints = {}, @@ -171,7 +171,9 @@ exports.create = function (conn, debuggerPort) { sourceIDs[s.sourceID] = s.url; s.url = shorten(s.path); delete s.path; - sendEvent('parsedScriptSource', s); + if (!config.hidden || config.hidden.indexOf(s.url) === -1) { + sendEvent('parsedScriptSource', s); + } }); }