I think you need to wait for the webpage to be fully loaded before you can invoke the script. There is a completed event on the WebBrowser control for this purpose. If you just want to test this theory out real quick, put your invoke script code in a button on your form. That way, you can wait for the page to load, then press the button to invoke the script. Also, while testing this, I suggest you make your "resize" JavaScript function do something really simple so you can be sure you'll notice when it's working. For example, you could simplify it to this (temporarily, for testing purposes):
function resize() { alert("Hello"); }