Last active
September 15, 2017 04:25
-
-
Save libliflin/1a32d79048774ff304a3 to your computer and use it in GitHub Desktop.
Skip opening devtools when programming mithril
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
error method makes it so i don't have to open up dev tools to see what went wrong. | |
must be in different <script> from your app code. | |
I use it in combination with Auto Reload https://addons.mozilla.org/en-US/firefox/addon/auto-reload/?src=api | |
*/ | |
window.onerror = function(msg, url, line, col, error) { | |
m.render(document, | |
m("html", [ | |
m("body", [ | |
m("table", [ | |
m("tr", [ | |
m("td", "url"), | |
m("td", url) | |
]), | |
m("tr", [ | |
m("td", "Message"), | |
m("td", msg) | |
]), | |
m("tr", [ | |
m("td", "Line number"), | |
m("td", line) | |
]), | |
m("tr", [ | |
m("td", "Column"), | |
m("td", col) | |
]), | |
m("tr", [ | |
m("td", "Error"), | |
m("td", error) | |
]) | |
]) | |
]) | |
]) | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment