This is a very cool use of shimming native functions. So far I've only seen malicious uses of function shimming. We discussed shimming Ajax calls to man-in-the-middle browser traffic in Chapter 7 in Ajax Security and Jeremiah had the very cool Array() constructor attack against Google before that. Here MooTools is shimming document.write() to prevent its blocking behavior. 3rd party advertisers and others use document.write()'s and it can harm page performance quite a bit. Typically web developers cannot do anything because since these commands come from 3rd party components they do not control. Now a developer can shim document.write(), still have ads, and not kill page load performance. very very cool. Replace document.write using MooTools |