-
Notifications
You must be signed in to change notification settings - Fork 469
investigate Custom Object Formatters in Chrome Dev Tools
#151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
note that we have almost all the meta data for a custom formatter (even the field names of submodules) |
Below is a simple snippet to recognize ocaml exception and print it in a reasonable way window.devtoolsFormatters = []
window.devtoolsFormatters.push({
header : function (x){
if (x.tag === 248){
return ["span", {"style": "background-color: #fcc"}, "exn/open variant", x[0]];
}else {
return null
}
},
hasBody : function(x){
return false
},
body: function(x){
return null
}
}) |
so we could wipe out custom object formatters, pretty printing, and json conversion all in the same manner, by generating a for example
I use json as an example, but we could just as easily produce a js object like |
Shipped! |
https://docs.google.com/document/d/1FTascZXT9cxfetuPRT2eXPQKXui4nWFivUnS_335T3U/preview#heading=h.xuvxhsd2bp05
The text was updated successfully, but these errors were encountered: