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.

Implement error page navigation using the Network Check failed OnNetCheckFailed handler

It is possible to configure a special event handler which will trigger when the RF signal cannot be detected for browser sessions. The handler can then navigate to a pre-defined URL. This technique can be important on WinCE platforms because the browser does not seem to preserve parameters when executing a "file:" type navigation. Without parameters, a static "error page" will not be able to determine the original target URL of the send request and will not be able to "re-try" the navigation.

The OnNetCheckFailed event will be generated if the network check action is ida://IDA_SCRIPT_ON_NETCHECKFAILED

The event will call the function OnNetCheckFailed( session, targetURL );

The handler for this event must already be defined and loaded into the CETerm script engine in order to be activated. A sample handler for this event might consist of:

 function OnNetCheckFailed( session, targetURL )
 {
    // Save target URL
    CETerm.SetProperty( "app.usertext.10", targetURL );
    // Navigate to static page
    var b = CETerm.Session( session ).Browser;
    b.Navigate("file:///error.htm");
 }

This handler will save the target URL into the User Text 10 area to make it available to the error.htm file. The error file may contain code which retries the original link, such as (for WinCE or .NET devices) shown below:

 function RetryTargetURL()
 {
   location.href = external.CETerm.GetProperty( "app.usertext.10" );
 }

If using this technique on Windows Mobile, you will need to create and use a CETerm (a.k.a. CEBrowseX) component rather than using the "external" object to access the CETerm.GetProperty().

This technique will also work on Windows Mobile platforms but is not required because the PocketIE on Windows Mobile will pass the parameters to a "file:" navigation. In this case, the network check action can be:

 file:///error.htm

The handler will append, for example:

 ?badlink=http://server.thisdomain.com/application.exe?param=1&param2=4

And the badlink parameter can be extracted and used in the error.htm page.

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.