'use strict';

var mlink = require('../midware');
var Router = mlink.Router;
var debuggerRouter = Router.get('debugger');
debuggerRouter.registerHandler(function (message) {
  if (message.payload.method === 'Debugger.scriptParsed' || message.payload.result && message.payload.result.frameTree) {
    message.discard();
  }
  message.to('proxy.inspector');
}).at('runtime.proxy');