Skip to content

Instantly share code, notes, and snippets.

@PavelLaptev
Created July 31, 2017 09:52
Show Gist options
  • Save PavelLaptev/dfa0aec1df37b58abf0b44294c1e7fe6 to your computer and use it in GitHub Desktop.
Save PavelLaptev/dfa0aec1df37b58abf0b44294c1e7fe6 to your computer and use it in GitHub Desktop.
Script allows you clearing print-console while you are coding
print.clear = () ->
console.clear()
try
consoleParent = document.getElementById("FramerContextRoot-PrintConsole")
consoleChild = consoleParent.children[0].children[1].children
arrForRemove = []
for i in [0...consoleChild.length]
if consoleChild[i].textContent.indexOf('»') isnt -1
arrForRemove.push(consoleChild[i])
if arrForRemove.length > 0
for i in [0...arrForRemove.length]
arrForRemove[i].remove()
divMsgClr = document.createElement('div')
divMsgClr.style.color = "rgba(0,0,0,0.3)"
divMsgClr.style.fontStyle = "italic"
divMsgClr.innerHTML = "» Print-console cleared"
consoleParent.children[0].children[1].appendChild(divMsgClr)
catch e
console.log "Print-console already clear"
print.clear()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment