declaraoids.findNameAndSexAsGenderWhereAgeGreaterThanXAndAddress_CityEqualsCity(persons, {x: 23, city: 'Bergen'});
[0]: https://github.com/Matsemann/DeclaraoidsIt creates a new data structure that behaves as an object but is backed by SharedArrayBuffer, in order to support parallel computation over it.
Basically youtube sends ads data in a window.ytInitialPlayerResponse variable. My extension loads before and intercepts this variable with proxy to prevent setting of window.ytInitialPlayerResponse.adPlacements field.
When I was writing this code, I looked into ublock origin filters, so this idea or may be even code could have been borrowed there, I don't really remember.
I also override JSON.parse and Response.json functions, because youtube can also send ad data with AJAX. One of those might be unnecessary, I'm not really sure.
Imagine an Object where you control _all_ the getting and setting.
Granted in very very tight loop regular object get/set will be faster, but performance is more than good enough today. If you have an use case for it, use it.
See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...