code: public static void whenReady(final EventListener function) {
      WebshimResources.eventLisenerQueue.add(function);
      if (WebshimResources.initializationStarted || WebshimResources.isInHeader()) {
        if (WebshimResources.isInitialized()) {
          WebshimResources.eventLisenerQueue
              .forEach(action -> action.handleEvent(WebshimResources.rememberEvent));
          WebshimResources.eventLisenerQueue.clear();
        }
        return;
      }
      WebshimResources.initializationStarted = true;
  
      JQueryResources.whenReady(event -> {
  
        final ScriptElement webshimScript = Browser.getDocument().createScriptElement();
        webshimScript.setSrc(WebshimResources.POLIFILLER_URL);
        webshimScript.setType(JsResources.SCRIPT_TYPE);
  
        Browser.getDocument().getHead().appendChild(webshimScript);
  
        webshimScript.setOnload(event2 -> {
          Webshims.setOptions(Json.parse( //
              "{\n" //
                  + "  \"forms-ext\": {\n" //
                  + "    \"replaceUI\": true\n" //
                  + "  }\n" //
                  + "}"));
          Webshims.polyfill("forms forms-ext");
          WebshimResources.eventLisenerQueue.forEach(action -> action.handleEvent(event2));
          WebshimResources.eventLisenerQueue.clear();
          WebshimResources.rememberEvent = event2;
        });
  
      });
    }
docs: async load of resources.
  
  @param function function to call on load