2 Replies Latest reply on Mar 11, 2008 9:44 PM by shoaibghauri

    AIR detection from HTML

      I want to find if my html page is opened in browser or is loaded in AIR through HTMLLoader. I need to ensure my event handlers (e.g onclick) work and in browser I am setting them up through innerHTML and in AIR like:
      element.onclick = onclick_handler_function;

      Currently I am using the following method:

      var browser = navigator.userAgent;
      browser = browser.toLowerCase();
      if(browser.indexOf('adobeair') > -1)
      //page is rendered in AIR, setup event handlers accordingly

      If anyone knows any better method of detecting AIR, please let me know.
      Also I dont want to include "AIRAliases.js" in the html page as the page is rendered using HTMLLoader and does not use any AIR apis.
      Thanks for any help.