diff --git a/dlls/mshtml/nsevents.c b/dlls/mshtml/nsevents.c
index f03b7313d1d..b61aec22fd5 100644
--- a/dlls/mshtml/nsevents.c
+++ b/dlls/mshtml/nsevents.c
@@ -136,6 +136,8 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event
if(!This->doc)
return NS_OK;
+ setup_nswindow(This->doc->window);
+
if(This->editor_controller) {
nsIController_Release(This->editor_controller);
This->editor_controller = NULL;