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 windowwindow.topor to the parent object of your current windowwindow.parent.
- You must include in your HTML-based extensions the latest version of theweb-platform.jsJavaScript file provided with thevSphere Web ClientSDK and added to each extension during generation. If you use an older version of this file, your HTML-based extensions might not work in thevSphere Web Clientand might cause other HTML-based extensions to stop working.
- To minimize future maintenance work and prevent incompatibility problems, do not change theweb-platform.jsJavaScript file on your own initiative. The file depends on thevSphere Web Clientversion 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 thevSphere Web Clientrunning HTML-based extensions, do not modify theWEB_PLATFORMobject. All HTML-based extensions use this global variable to access thevSphere Web Clientplatform APIs. For example, if you change this variable, other HTML-based extensions that use theWEB_PLATFORM = self.parent.document.getElementById("container_app")variable initialization might stop working.