Search code examples
javascriptinternet-explorer-8onblurdocument-body

How do I disable body.blur() in IE8?


I work on an enterprise web application that runs in IE8. It appears blur() is being called on the body causing the IE window to be sent to the background. Unfortunately this code is in a portion of the application that is controlled by the vendor.

Is there any possible way to prevent blur() from being called on the body without modifying the code that is actually calling body.blur()?

Since this is an enterprise application, solutions outside of changes in the application itself are acceptable; Such as changes to IE8 settings, registry, etc.


Solution

  • You should be able to hard code blur to a dummy method. If you can get in before it is called, just call body.blur = function() {}; (assuming body is pointing to your DOM body element).