Wednesday, March 28, 2012

Browser Version Detection (OHS Customization Part 2)

One of my customers running EPM faced issues last week when some of their end users had received new laptops with Internet Explorer 9 installed. It took some time for the IT department and EPM admins to figure out that the random problems that were being reported were actually caused by the unsupported browser version instead of other technical issues. We discussed how to work around the problem of unwanted browser versions - the most important method being centralized control over browser installations of course - but this gave me an idea of giving EPM end users a warning in case they were using an unsupported web browser.

This solution is partly based on my earlier post about OHS customization. We instructed the customer's end users to use the OHS default page as their entry point to EPM Workspace - in my examples below this address will be http://epmtest1.local:19000/ . On the OHS default page I placed a Javascript function that compares the browser version number to those specified by the EPM System Certification Matrix document. If the version matches the requirements the browser will immediately be redirected to the actual Workspace address (http://epmtest1.local:19000/workspace/) without the user noticing a thing. In case the version number is not found on the list of supported ones the user is shown a message telling that they may run into problems by using the particular web browser. In the screenshots below I used Firefox 11 to trigger the warning on my virtual sandbox installation:

Web browser alert window

Web browser version warning

At the core of this hack user interface guidance solution is a piece of Javascript from The welcome page calls the version detection function and then compares the resulting browser name and version number to the browsers supported by EPM (Internet Explorer 7 and 8, Firefox 3.5 and 3.6). Below you can see a simplified version of the Javascript code.

   // Place your Workspace URL here
   var workspaceUrl = 'http://epmtest1.local:19000/workspace/';

   // Check if the browser is IE 7 or 8
   if (BrowserDetect.browser=='Explorer' && (BrowserDetect.version == 7 ||

      BrowserDetect.version == 8) ) {

      // Browser version ok (IE) - redirect to the Workspace address
      window.location = workspaceUrl;

   // Check if the browser is Firefox 3.5 or 3.6
   } else if (BrowserDetect.browser=='Firefox' &&

      (BrowserDetect.version == 3.5 || BrowserDetect.version == 3.6) ) {

      // Browser version ok (Firefox) - redirect to the Workspace address
      window.location = workspaceUrl;

   } else {

      //Browser version not supported - display a warning
      alert('Warning! Incompatible browser version (' + BrowserDetect.browser

         + ' ' + BrowserDetect.version +')! Please contact your EPM/Hyperion

To implement the script you just need to copy the modified welcome-index.html and the browserdetect.js file to your OHS htdocs directory (for example C:\Oracle\Middleware\user_projects\epmsystem1\httpConfig\ohs\config\OHS\ohs_component\htdocs). The only "moving part" you need to change is the Workspace URL defined in the workspaceUrl variable.

The HTML and Javascript code are web server independent so you can use them with IIS as well — just rename the HTML file to default.htm and place it (and the .js file) to the IIS web root folder (typically C:\Inetpub\wwwroot).

Download a zip file containing the files here (hosted by Google Sites).
The original BrowserDetect script can be found on

No comments :

Post a Comment