summaryrefslogtreecommitdiffstats
path: root/devtools/client/debugger/test/mochitest/examples/doc_dbg-custom-formatters.html
blob: d7ddb97d4e3bc49f16c6a45f8f24a945ced9dd44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8"/>
    <title>Debugger custom formatters test page</title>
  </head>
  <body>
    <p>Custom formatters test page</p>
    <script>
      "use strict";

      window.devtoolsFormatters = [
        {
          header: obj => {
            if (obj.hasOwnProperty("customFormatHeaderAndBody")) {
              return ["span", {"style": "font-style: italic;"}, "CUSTOM"];
            }
            return null;
          },
          hasBody: obj => true,
          body: obj => ["span", {"style": "font-family: serif; font-size: 2rem;"}, obj.customFormatHeaderAndBody]
        }];

      function pauseWithCustomFormattedObject() {
        const xyz = {customFormatHeaderAndBody: "customFormattedBody"};
        debugger;
      }
    </script>
  </body>
</html>