function doDebugInfo(a){var b=localStorage.startCapture;"true"===b&&($("#debugInfo").append('<span class="'+a.debugInfo+'">'+a.content+"</span>"),$("#debugInfo").scrollTop($("#debugInfo")[0].scrollHeight))}function selectText(){var a=document,b=a.getElementById("debugInfo");if(a.body.createTextRange){var c=a.body.createTextRange();c.moveToElementText(b),c.select()}else if(window.getSelection){var d=window.getSelection(),c=a.createRange();c.selectNodeContents(b),d.removeAllRanges(),d.addRange(c)}}var safeToleave=!1;chrome.runtime.onConnect.addListener(function(a){console.assert("debug"==a.name),a.onMessage.addListener(function(a){switch(a.type){case"debugInfo":doDebugInfo(a)}})}),$(function(){"true"===localStorage.startCapture?($("#stop-capture").show(),$("#start-capture").hide()):($("#stop-capture").hide(),$("#start-capture").show()),$("#close-debug").click(function(){safeToleave=!0,localStorage.debug=!1,chrome.runtime.reload()}),$("#stop-capture").click(function(){$("#stop-capture").toggle(),$("#start-capture").toggle(),localStorage.startCapture="false"}),$("#start-capture").click(function(){$("#stop-capture").toggle(),$("#start-capture").toggle(),localStorage.startCapture="true"}),$("#clearcontent").click(function(){$("#debugInfo").html("")}),$("#selecttext").click(function(){selectText()})});