Re:Show HN: A library to record and intercept JavaScript at ...
by z3t4 on Sunday September 10, 2017 @04:34AM
(#15211353)
yes, but you have to manually select which objects to watch, eg in your script, it goes through the window object and adds the Proxy observer to a set of classes. But Iroh doesn't use Proxies. With Iroh you can trigger an event for example "Iroh.MEMBER" and check if the property is undefined.
[ Parent
| on HN ]
Re:Show HN: A library to record and intercept JavaScript at ...
by ldd on Sunday September 10, 2017 @08:16AM
(#15211883)
I only observe certain classes because observing anything and everything is not convenient. Nothing prevents you from doing
`window = new Proxy(window, handler)`
(or more generally, to Proxy the global object) where the handler replaces anything with a Proxied version of it either once a trap triggers (yu-gi-oh style) or immediately.
Then again, I did not write the specification for `Proxy` and Iroh is cool. It probably has plenty of use-cases where Proxy would not do a good job. I'm just showing what we have right now.