close

Filter

loading table of contents...

Site Manager Developer Manual / Version 2301

Table Of Contents

3.10 Define the Browser for Web Extensions

You can define the browser for the web extensions using the element <WebBrowsers>. Multiple browsers for different locales and operating systems can be defined. The browser for the preview can be chosen from the File|Preview menu of the overview window. If you do not define any browser, the web extensions cannot be executed.

<WebBrowsers>

Child elements: <WebBrowser>

Parent elements: <Editor>

<Editor>
  ..
    <WebBrowsers>
      ..
    </WebBrowsers>
..
</Editor>

You can use the <WebBrowsers> element to configure web browser definitions for Web Extensions such as the preview with the <WebBrowser> child element. The <WebBrowsers> element has no attributes.

<WebBrowser>

Parent elements: <WebBrowsers>

      <WebBrowsers>
  <!-- Standard Windows IE installation -->
  <WebBrowser id="Internet Explorer" os="win" 
  command="c:\\Program Files\\Internet Explorer\\Iexplore.exe %s"/>

  <!-- IE installation in german locale on Windows -->
  <WebBrowser id="Internet Explorer" os="win" language="de" 
  command="c:\\Programme\\Internet Explorer\\Iexplore.exe %s"/>
</WebBrowsers>

    

This element configures web browser installations for a given locale of the Site Manager and operating system. Web extensions (see <WebExtension>) may open several web browsers (Preview) or the first matching web browser. Therefore, the order of <WebBrowser> elements is important.

The example above configures two Windows web browsers, one with language attribute set to ‘de’. If a web extension running on German locale wants to select a browser, it should open the German browser. A precedence list defines which browser is selected.

  1. os

  2. language

  3. country

  4. no attribute

In the example above, for both browsers the os attribute has been set but the German browser is selected because it has a language attribute that matches the language of the German locale. If you delete the os attribute in the German browser configuration, the other browser will be opened.

In rare conditions a matching browser can not be opened. Take, for example, the configuration above and call a preview web browser from a Site Manager with a German locale on a French Windows system. The command c:\\Programme\\Internet Explorer\\Iexplore.exe %s can not be executed on the French system because "Programme" will not be found. In this case, the first browser is taken that can be opened, independently of any os or language settings.

AttributeDescription
idThe name of the browser, such as Internet Explorer. Use the same id for the same browser application, like FireFox for all Firefox configurations.
osThe name of the operating system or a prefix thereof. It must equal or be a prefix of the Java system property os.name. This attribute is optional. If not set, the command must be executable on all operating systems your Site Manager runs on.
languageThe language of the locale. The value must conform to a valid language in a Java java.util.Locale instance. For the English language the valid value is ‘en’ for the German language the valid value is ‘de’. This attribute is optional.
countryThe country of the locale. The value must conform to a valid country in a Java java.util.Locale instance. For the USA the valid value is ‘US’ for Germany the valid value is ‘DE’. This attribute is optional.
command

The command to start a browser with a given URL on the configured operating system. For the Internet Explorer on an English Windows installation the command looks as follows:

c:\\Program Files\\Internet Explorer\\ Iexplore.exe %s

The suffix %s is the placeholder for the URL to load in to the browser.

optional

Specifies whether this browser is optional. This feature is used by the Preview web extension when doing a preview with all configured browsers (for example by clicking the Preview button in the toolbar or by selecting File|Preview|All). The Site Manager only shows errors for non-optional browsers or if no browser could be started at all.

Allowed values are true and false. Default is false

Table 3.9. The attributes of the <WebBrowser> element


Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.