doc_dbg-custom-formatters.html (1308B)
1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="utf-8"/> 5 <title>Debugger custom formatters test page</title> 6 </head> 7 <body> 8 <p>Custom formatters test page</p> 9 <script> 10 "use strict"; 11 12 window.devtoolsFormatters = [ 13 { 14 header: obj => { 15 if (obj.hasOwnProperty("customFormatHeaderAndBody")) { 16 return ["span", {"style": "font-style: italic;"}, "CUSTOM"]; 17 } 18 return null; 19 }, 20 hasBody: obj => true, 21 body: obj => ["span", {"style": "font-family: serif; font-size: 2rem;"}, obj.customFormatHeaderAndBody] 22 }, { 23 header: (obj, config) => { 24 if (obj.hasOwnProperty("customFormatObjectAndConfig")) { 25 return [ 26 "span", 27 {}, 28 `object tag: `, 29 [ 30 "object", 31 { 32 object: null, 33 } 34 ], 35 ]; 36 } 37 return null; 38 }, 39 }]; 40 41 function pauseWithCustomFormattedObject() { 42 const abc = {customFormatObjectAndConfig: true}; 43 const xyz = {customFormatHeaderAndBody: "customFormattedBody"}; 44 debugger; 45 } 46 </script> 47 </body> 48 </html>