I was wondering if it is somehow possible to intercept all JavaScript API calls of a website using a browser extension.
The background is that I would like to log what APIs some websites use and even block access to certain APIs or simply provide fake data instead of real data.
I know you can intercept HTTP requests etc, but I would really like to just find out when an API is actually accessed.
So for instance, I would like to find out when webRTC or webGL are being used, when a canvas is being read/manipulated or even when a website checks the mouse cursor position.
I couldn't really find anything on google about this. Did I miss anything? Or are you aware that something like this will be implemented in the future? I would really like to know.