Related sites:
More related sites:

Naurtech Support Wiki

Navigation: Print | Search | Wiki Home | Back to www.naurtech.com

Support Topics

  • Home
  • Usage Videos
  • Scripting
  • Web Browser
  • Download & Setup
  • License Registration
  • Cold Boot Persistence
  • Barcode Scanner
  • Remapping keys
  • Sounds & Tones
  • Lockdown & Fullscreen
  • Misc. & Usage Tips
  • Tools & Utilities

Wiki Actions

  • View
  • Edit
  • Print
Naurtech Corporation Copyright. All rights reserved.

Detect offline sessions

An "offline" session can mean one of many things. The actual meaning depends on your interpretation. It can be:

  1. an emulation session which is connected to the host but not logged onto the host application
  2. an emulation session which is disconnected
  3. a browser session which receives a page with title "Offline"

For 1), you can simply look for text on the screen. This can be done using the OnReceive handler. For 2) you can implement a handler for the OnSessionDisconnect and OnSessionDisconnected events.

This script will detect the "Offline" page in a browser session and will redirect the CETerm browser to the login screen. This is about the same as the user pressing a key mapped to "URL Home".

To download the script, right mouse click and "Save Target As..." SAPOffline.js

/*OnDocumentDone*/
function OnDocumentDone( session )
{
    // Get document object
    var d=CETerm.Session(session).Browser.Document;

    // Compare title
    if(d.title.match("Offline"))
    {
        // Return to home URL
        var script = "CETerm.PostIDA('IDA_URL_HOME'," + session + ");";
        CETerm.SetTimeout( script, 500 );
    }
}

The article is provided as a service to current and perspective Naurtech customers. Trademark references made to various companies and their products belong to the respective companies. All information is provided as is. For questions, please contact us at  support@naurtech.com.