What is Nostr?
Nathan Knowler /
npub16xc…096v
2023-12-01 19:13:59

Nathan Knowler on Nostr: Custom element idea: declarative debugger element. Effectively, it’d be the browser ...

Custom element idea: declarative debugger element. Effectively, it’d be the browser developer tool’s “Break On” setting for elements, but something you could add to your HTML as you develop. It’d be a `debugger` statement wrapped in a `MutationObserver` that would be configured by the custom element’s API. It could probably do a bit more than what the dev tools provide, but that could be the start.

Rough API:

```html
<break-on type="subtree-modifications">
<div>Element subject to subtree changes</div>
</break-on>
<break-on type="attribute-modifications" attributefilter="class">
<div>Element subject to attribute modifications</div>
</break-on>
```

#WebComponents
Author Public Key
npub16xcwggeqkc0gsgh7t39z3hnrpfh4hde6py3vashnv7hrv49gxrcscy096v