Jump to content

How to prevent IE8-- run unigui?


stlcours

Recommended Posts

As you now, if the client use IE6, there are so many problems(I think the main problem is that its JS engine is so slow so some problems occurs.) I think you can make an option to prevent IE8-- run unigui. Event the client cannot use the application with IE6, but it can also avoid some unknown errors, doesn't it?

 

Thanks in advance.

Link to comment
Share on other sites

uses ExtPascal;

procedure TfrmMain.UniFormCreate(Sender: TObject);
var
  l_userAgent : String;
begin

  { Check client browser }
  if UniSession.Browser in [brUnknown, brIE, brKonqueror] then
  begin
    l_userAgent := UniSession.RequestHeader['HTTP_USER_AGENT'];

    { Different message for IE }
    if UniSession.Browser = brIE then
    begin
      if (Pos('MSIE 8', l_userAgent) > 0)
        or (Pos('MSIE 7', l_userAgent) > 0)
        or (Pos('MSIE 6', l_userAgent) > 0) then
        UniSession.AddJS('alert("Probablemente Ud. está utilizando una versión ' +
          'de Internet Explorer muy vieja.\nSi continúa utilizándolo, ' +
          'el Sebaot Web puede llegar a experimentar comportamientos inadecuados.\n' +
          'Recomendamos que actualice su Internet Explorer a una versión más nueva\n' +
          'o utilice otro navegador como ser, el Firefox o el Chrome ' +
          'para usar el Sebaot Web en este equipo.");');
    end else
      UniSession.AddJS('alert("Probablemente Ud. está utilizando un navegador ' +
        'que no es compatible con las funciones necesarias para utilizar el ' +
        'Sebaot Web.\nSi continúa con su uso, el Sebaot Web puede llegar a ' +
        'experimentar comportamientos inadecuados.\nRecomendamos que utilice ' +
        'otro navegador como el Firefox o el Chrome.");');
  end; // if
end;

I hope this can be usefull for You...best Regards.

  • Upvote 3
Link to comment
Share on other sites

  • 4 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...