Browsium

Browsium Blog

Let’s Get Technical: Using Content Handlers with UniBrows Profiles

Posted by: Browsium Posted date:

Welcome back to our ongoing series on the technical side of UniBrows features. Today we’re focused on custom Content Handlers.

Content Handlers are all about downloads. They give administrators the ability to mandate specific procedures that are taken when files are downloaded (i.e. open a certain type of file with a specific program or run a command on a downloaded file when the file has a specific extension). Additionally, due to limitations in Internet Explorer, Content Handlers are necessary in order to perform any form of file download when using the Internet Explorer 6 Engine. If users of a Profile that uses the Internet Explorer 6 Engine would like to perform any type of file downloading on sites rendered by that Profile, the file types that they would like to download must have specific entries in a Content Handler enabling their download. Otherwise, users will not be able to download the files. Downloads can be performed without any entries in a Content Handler on any other Profile that doesn’t use the Internet Explorer 6 Engine, assuming that the administrator has disabled sandboxing on that Profile. Please remember that these restrictions only apply to sites being handled by a UniBrows rule & profile – this does not apply to sites rendered with the native browser (IE8 or IE9).

Regardless of whether a Content Handler is necessary to enable file downloading on the Profile that you are concerned with, Content Handlers provide a great way for administrators to manage the types of files that users are able to download and what is done with those files as soon as they are downloaded (e.g. passing all files through a virus scanner).

Features / Interface

The following screenshot was taken off the Content Handlers tab:

The Content Handlers Tab consists of the following features:

  1. Content Handlers List
    This list displays all configured Content Handler mappings. To add, edit or remove a Content Handler mapping, use the buttons on the right hand side or simply right click inside this window select the desired option from the context menu.
  2. Create Handler
    To create a new Content Handler mapping, click the Create Handler button. For more information on this, see below.
  3. Edit Handler
    To edit a Content Handler mapping, highlight the item and use the right click context menu or click the Edit Handler button on the right hand side.
  4. Remove Handler
    To remove a Content Handler mapping, either highlight the item and use the right click context menu or click the Remove Handler button on the right hand side.

Managing Content Handlers with the UniBrows editor

The Content Handler Editor window is where all configurations and settings are managed for individual Content Handlers.

This editor offers you the ability to configure the following properties of a Content Handler:

  1. Type Class
    There are two possible values for Type Class: File Type and MIME Type. For File Type, UniBrows will trigger on all files with the specified file type. For MIME Type, UniBrows will trigger on all files with the given MIME type. MIME types are specified in the response headers from the remote web server.
  2. Type Name
    Values for the Type Name field depend on what was selected for the Type Class value. For File Type, specify the file extension (e.g. .pdf) in the Type Name field. If you choose to refer to a file extension, remember to include the period before the file type as well! (e.g. ‘.xlsx’ and not just ‘xlsx’). For MIME Type, specify the MIME type (e.g. application/pdf) in the Type Name field. A complete listing of possible MIME types can be found at http://reference.sitepoint.com/html/mime-types-full.
  3. Enabled
    All Content Handlers are enabled by default when they are created. To disable a Content Handler, simply change the value of this field to ‘No’.
  4. Action
    This setting determines what action the UniBrows Client will take when a download covered by a Content Handler is encountered.Possible options for this setting are:

    •  Prompt for Download
      The Content Handler will prompt the user to save the file that is being downloaded.
    • Open Default Program
      The Content Handler will download the file to temporary storage location and attempt to launch the file in the default application.
    • Run Command
      The Content Handler will download the file to a temporary storage location and run the custom command specified in the “Command” field. To insert the name of the file in the custom command, use the “%1” macro (“c:exampletest.exe” “%1”).
    • Do Nothing
      The Content Handler will ignore the content and cease processing the request. Choose this option to prevent users from running or saving specific file types that you choose to disable.
  5. Command
    If the Action setting value is set to Run Command, the Content Handler will download the file to a temporary storage location and execute the text. To insert the full path and file name of the downloaded file, use the “%1” macro.

Example 1

The following screenshot of a Handler Editor window illustrates the solution to a common scenario where users of a web application that requires rendering in the Internet Explorer 6 Engine also need to be able to download .jpg files from the site. Another extension could be substituted for .jpg (i.e. .pdf, .doc, .xlsx, .png, etc.) and that file extension would then be supported.

Example 2

The following screenshot of a Handler Editor instance outlines an example scenario where files of MIME type “application/pdf” are downloaded to a temporary location and passed to an application via a command line.  The downloaded file is passed to the command line via the “%1” variable.

Summary

This powerful feature allows you to take explicit control of how Internet Explorer handles different file types when running under UniBrows, and is available in versions 1.2 and later of UniBrows.

-Christopher

  • Share:  
 

Recent Posts

Java, what will become of thee?
Posted on: February 13, 2020
New Webinar
Posted on: February 10, 2020
Edge is coming (and Winter is here)
Posted on: January 24, 2020

Request Demo