Unfortunately: No, it does not exist.
There is something called Proxy Objects presented in the Gecko 18 browser
What will allow you to do such things
(function (original, Window) { var handler = { get: function (target, propertyName) { console.log('Accessing property', propertyName, 'of window.'); return target[propertyName]; } }; Window = new Proxy(original, handler); console.log(Window.setTimeout);
But it is not standard and still very unstable
Btw I initially thought you could use window directly as a local variable in IIFE, but it seems you can't just log in undefined (I wonder why), so I capitalized the letters "W"
Here is an example on JSBin
Note. You must visit it in Firefox.
C5H8NNaO4
source share