final Event event = new Event(this, Event.TYPE_LOAD);
final Node scriptObject = (Node) getScriptObject();
final PostponedAction action = new PostponedAction(getPage()) {
@Override
public void execute() throws Exception {
scriptObject.executeEvent(event);
}
};
final String readyState = htmlPage.getReadyState();
if (READY_STATE_LOADING.equals(readyState)) {
htmlPage.addAfterLoadAction(action);