function doDebugInfo(e){var t=localStorage.startCapture;"true"===t&&($("#debugInfo").append('<span class="'+e.debugInfo+'">'+e.content+"</span>"),$("#debugInfo").scrollTop($("#debugInfo")[0].scrollHeight))}function selectText(){var e=document,t=e.getElementById("debugInfo");if(e.body.createTextRange){var o=e.body.createTextRange();o.moveToElementText(t),o.select()}else if(window.getSelection){var a=window.getSelection(),o=e.createRange();o.selectNodeContents(t),a.removeAllRanges(),a.addRange(o)}}var safeToleave=!1;chrome.runtime.onConnect.addListener(function(e){console.assert("debug"==e.name),e.onMessage.addListener(function(e){switch(e.type){case"debugInfo":doDebugInfo(e)}})}),$(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()})});