convert to DOM for debugging into Node scripts

Fix rogerwang/node-webkit#2214