TTech

[ Home | Main Projects | Java Demos | Contact InformationVaccation Time ... | ]


Main Projects

» IE Browser Toolbar

Main Menu

» IE Browser Toolbar

Private Area

» Login

Functionality

Basic

     The Company Toolbar is a standard CSS2 compatible HTML browser! It can execute scripts, applets, ActiveX controls (<SCRIPT>, <APPLET>, <OBJECT>) which makes the toolbar very universal.
The HTTP requests sent to and from the main browser are preprocessed in the toolbar DLL, thus enabling the toolbar to extract any information which is sent to the main browser. A mechanism for handling this content has been implemented and will be described latter in this document. The toolbar can also load HTML pages in the main browser with this is done with the following command:
<A href="browser:URLtoBrowser">...</A>
In this case the HTML document in the toolbar remains the same but the main browser starts to load the given ‘URLtoBrowser’ document.

Extendet

     Every HTML document loaded by the toolbar is scanned for <META name=”TT_TOOLBAR”…> tags. Those META tags tell the toolbar DLL to start operating in ‘extended’ mode. For example if the HTML document is to be registered as client/consumer for specific events the HTML document sent to the toolbar has to contain the following element:
<HEAD>
...
<META name="TT_TOOLBAR" content="toolbarevents">
...

The meta content ( in the example above: “toolbarevent” ) is passed as a parameter to the function OnBrowserMeta( url, meta ) ( meta=”toolbarevent”). see the description of this function latter in this document.

  • function OnToolbarConnect( toolbar )

  • Immediately after the document is fully loaded by the toolbar the following JavaScript function is called:
    <SCRIPT language="JavaScript" type="text/javascript">
    function OnToolbarConnect( toolbar ) {
    ...
    }
    ...

    The input parameter ‘toolbar’ of the function OnToolbarConnect is an object which encapsulates additional functionality preprogrammed in the DLL of the toolbar. Those methods are:
  • toolbar.GetVersion()
  • toolbar.BrowserGoto( url )
  • toolbar.BrowserGoto( url, target )

  • toolbar.GetVersion() returns string with the following format: “MAJ.MIN”, where MAJ and MAN are numbers, the current version is “2.00”
    toolbar.BrowserGoto( url ), the parameter url is a string: redirects the browser to the given url.
    toolbar.BrowserGoto( url, target ), both parameters are string: redirect given ‘frame’ to the given url. Valid are also the reserved: “_blank”, “_self”… etc.

    NOTE: upon request additional methods can be included in the object toolbar in the DLL.
    Normally the implementation of the function OnToolbarConnect() should save the object ‘toolbar’ in a global variable, which can be called by other JavaScript functions. Example implementation:
    <SCRIPT language="JavaScript" type="text/javascript">
    // global variable definitions
    // **********************************
    var TBar;
    ...
    // toolbar event handlers
    // **********************************
    function OnToolbarConnect( toolbar ) {
    TBar = toolbar;
    ...
    }
    ...


  • function OnNavigateBrowser( url, header, target, post )

  • This function is called before the browser starts to load any document. The input parameters contain information about the document which is to be loaded by the main browser. URL contains the url of the document which is to be loaded; header contains an additional header, if it is to be sent to the server (for example when forms are posted); target contains the target frame where this document is to be loaded by the browser; post is the HTTP method.

    NOTE: this function can return FALSE, which means that the browser request will be cancelled.
    This function can be used for the following purposes:
  • Managing toolbars which are context dependent.
  • Catching of parameters sent to the browser.
  • automatic ‘login’of the toolbar depending on the passed on to the browser parameters (for example when a SessionID from the Company server is passed on to the main browser the toolbar can find out if a user has already logged on to the Company site and a user specific toolbar will be loaded!)
  • blocking the browser to load given resources.


  • function OnBrowserDocument( url, document )

  • This function is called when the main browser is done with loading a new document. The input parameters include the url of the document and the document itself.

    NOTE: the input parameter ‘document’ is a valid object!
    The function can be used for the following purposes:
  • tracking of cookies
  • modification of the document
  • modification of the toolbar depending on what the document contains.
  • automatic ‘login’-of the user who is the toolbar owner (for example tracking SID cookie for a given server!) This means that if Company wants to track if the owner of the browser on which the toolbar operates is logged in one of the Company tools, this is done in the implementation of this function (if url == Company.url … the SID cookie is sent to the toolbar server; the server finds out to which user this SID belongs and sends back to the toolbar a user specific HTML.


  • function OnBrowserMeta( url, meta )

  • This function is called when in the main browser a new document is loaded and this document contains meta tags with the name “tt_toolbar”: <META name=”TT_TOOLBAR”…>. The parameter url is the url of the loaded document; the parameter meta is the context of the <META …> element.
    The function can be used for the following purposes:
  • context dependent toolbars
  • update(refresh) of the toolbar

  • Example: in the current realization of the sample toolbar server the function onBrowserMeta is defined in the tsToolbar.htm template. The body of this function is:
    function OnBrowserMeta( url, meta ) {
    if ("refresh" == meta) {
    document.location = "/servlets/servlet/toolbar";
    }
    this forces the toolbar to refresh itself if the meta parameter is equal to “refresh”.
    Similarly one can define context dependent toolbars (i.e. when the toolbar user browses “special” documents which contain TT_TOOLBARMETA tags which tell the toolbar to load a different document.

  • function OnCompleteBrowser( url )

  • The function is called when in the browser the loading of a resource is completed.
    The function can be used for the following purposes:
  • defining automation of the toolbar – for example enabling certain buttons only after the document of the browser has been fully loaded.


  • function OnBrowserEvent( code, action, data1, data2 )

  • This function is called when java script function in the document in the main browser calls a java script function in the toolbar upon an event in the main browser. For more information see the implementation of the method toolbar.Event(code, action, data1, data2 ).
    The function can be used for automation between java scrip functions in the main browser and in the toolbar.

    <prev< [Page 2 of 3 | TOC] >next>


    Last updated: Jan 10, 2006 (Ver: 1.0)Copyright © 1999-2006 TTechGroup LLC. All rights reserved.