Best Practices for Developing HTML-Based Extensions

You can use the
vSphere Web Client
SDK and the
vSphere Client
development kit to create HTML-based extensions.
Starting with vSphere 5.5 Update 1, an HTML Bridge infrastructure is added to the
vSphere Web Client
that provides support for HTML-based extensions. The
vSphere Web Client
SDK provides APIs, tools, and samples that can help you extend the
vSphere Web Client
.
Starting with vSphere 6.5, you can use the
vSphere Client
to connect to
vCenter Server
systems and manage vSphere inventory objects. The
vSphere Client
development kit is provided to developers that want to create HTML5-based extensions for both Web browser applications. For backward compatibility, the
vSphere Client
development kit contains the same APIs as the HTML Bridge.
Follow these best practices when you create your HTML-based solutions.
  • Make sure that your HTML and JavaScript code is fully functional on different Web browsers and provides the same user experience.
  • You must not send calls to the topmost browser window
    window.top
    or to the parent object of your current window
    window.parent
    .
  • You must include in your HTML-based extensions the latest version of the
    web-platform.js
    JavaScript file provided with the
    vSphere Web Client
    SDK and added to each extension during generation. If you use an older version of this file, your HTML-based extensions might not work in the
    vSphere Web Client
    and might cause other HTML-based extensions to stop working.
  • To minimize future maintenance work and prevent incompatibility problems, do not change the
    web-platform.js
    JavaScript file on your own initiative. The file depends on the
    vSphere Web Client
    version and is updated with each major release of the SDK. If the file changes between major releases, you must see whether the release notes contain any instructions for manual changes that you must apply to the file before generating your plug-in packages.
  • To ensure the integrity of future versions of the
    vSphere Web Client
    running HTML-based extensions, do not modify the
    WEB_PLATFORM
    object. All HTML-based extensions use this global variable to access the
    vSphere Web Client
    platform APIs. For example, if you change this variable, other HTML-based extensions that use the
    WEB_PLATFORM = self.parent.document.getElementById("container_app")
    variable initialization might stop working.