title: window.body.scrollHeight does not change when decreasing height
body: <p>So I am trying to create a way to detect when the body resizes and then I grab the new height and send it through a postmessage. The not correctly functioning part is when I downsize the body ( when I removed(hide) some elements so the body shrunk). This does not get detected as the window.body.scrollHeight simply holds the last value. 
  Here is my code and I would appreciate any suggestions:</p>
  
  <pre><code>  sendMessage();
    checkDocumentHeight(sendMessage);
    function sendMessage(){
      var heightWidth = document.body.scrollHeight+ " " +document.body.scrollWidth;
      parent.postMessage(heightWidth, "*");
    }
    function checkDocumentHeight(callback){
        var lastHeight = document.body.scrollHeight, newHeight, timer;
        (function run(){
            newHeight = document.body.scrollHeight;
            if( lastHeight != newHeight )
                callback();
            lastHeight = newHeight;
            timer = setTimeout(run, 1000);
        })();
    }
  </code></pre>