class InjectHandle
injectMethod = null
callCount = 0
constructor:()->
codeTempl = """
<style media="screen">
html, body {
height: 100%;
margin: 0px;
padding: 0px;
}
.debug_code{
position: fixed;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.3);
color: #FF0000;
overflow: auto;
padding: 20px;
pointer-events: none;
}
</style>
<div id="debug_code" class="debug_code">
debug_code
</div>
"""
$('body').append(codeTempl)
injectMethod= window.onChange
window.onChange = handle
handle = ()->
injectMethod()
$('#debug_code').html("callCount:#{callCount++}")
new InjectHandle();