2 Replies Latest reply on Oct 29, 2010 11:51 AM by DARTHCYL0N

    AIR Application Sandbox Bridge Issue

    DARTHCYL0N

      I am having an issue accessing the sandbox bridge from my application core page.

      The only thing I think it might be is I am using ajax for a login procedure so it might bolo it because of that.

      if anyone has any ideas I could use a fresh pair of eyes,

       

      If I strip it and create a new basic client I can get the sandbox bridge to work and launch the internet explorer , but with this client it won't

       

       

      here is the code for my AIR app document

       

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

       

      <html xmlns="http://www.w3.org/1999/xhtml">

       

      <head>

      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

      <title>Viper: Nuclear Edition</title>

      <link rel="stylesheet" type="text/css" href="../../lib/css/viperapp-interface.css" />

      <link rel="stylesheet" type="text/css" href="../../lib/css/module-headers.css" />

      <link rel="stylesheet" type="text/css" href="../../lib/css/p7exp.css" />

              <script src="/AIRAliases.js"></script>

      <script type="text/javascript" src="../../lib/js/scripts.js"></script>

      <script type="text/javascript" src="../../lib/js/p7exp.js"></script>

              <script language="javascript">

      //This code is placed in the root document header

      //This function is written to run from the sandbox. It opens a url in an external browser

       

       

      function processURL(){

      var searchString = document.location.search;

      // strip off the leading '?'

      searchString = searchString.substring(1);

       

      var nvPairs = searchString.split("&");

       

      for (i = 0; i < nvPairs.length; i++)

      {

      var nvPair = nvPairs[i].split("=");

      var name = nvPair[0];

      var value = nvPair[1];

      }

      alert(searchString);

      }

       

      function remoteLogin(){

      var searchString = document.location.search;

      viperframe.location.href = 'http://devcenter.viperapp.com/cgi/login.cfm'+ searchString;

      }

       

      function testRemote(){

      alert('this is working');

      }

       

      function noLogin(){

      alert('Your login information was incorrect, please try again');

      top.location.href="login.html";

      }

       

      //This code is placed in the root document header

      //This function is written to run from the sandbox. It opens a url in an external browser

      function openExternalURL(href) {

      var request = new air.URLRequest(href);

      try {

      air.navigateToURL(request);

      }

      catch (e) {

      alert(e);

      }

      }

       

      var Exposed = new Object();

      // expose the trace() function.

                   Exposed.trace = function(str) {

                      air.trace(str);

                   }

      Exposed.openExternalURL = openExternalURL;

      Exposed.testRemote = testRemote;

      Exposed.noLogin = noLogin;

       

      function doLoad() {

      //Place the Exposed object on the parentSandboxBridge property of the ui frame's window object.

      var frame =  document.getElementById('viperframe').contentWindow.parentSandboxBridge = Exposed;

      setIframeHeight('viperframe');

      remoteLogin();

      // window.callMe = document.getElementById('viperFrame').contentWindow.childSandboxBridge.callMe;

      //var frame = document.getElementById('viperFrame').contentWindow.parentSandboxBridge = Exposed;

      }

       

      </script>

       

       

      </head>

       

      <body onload="doLoad();" onresize="setIframeHeight('viperframe');" onfocus="setIframeHeight('viperframe');" bgcolor="#222222">

      <!-- END P7EXP PULLDOWN MENU -->

      <div id="headerToolBar">

      <div id="headerToolUser">

      <ul>

      <li><a href="javascript:void(0);">Logged in  <strong>

                          </strong></a></li>

      <li><a href="login.html" target="_parent"><strong>Log Out</strong></a></li>

      <li><div id="windowTools"><a href="javascript:void(0);" onClick="parent.minimizeWindow()"><img src="../../lib/img/headertoolbar/icon_minimizewindow.png" width="18" height="18" border="0" /></a><a href="javascript:void(0);" onClick="parent.maximizeWindow()"><img src="../../lib/img/headertoolbar/icon_expandwindow.png" width="18" height="18" border="0" /></a><a href="javascript:void(0);" onClick="parent.closeWindow()"><img src="../../lib/img/headertoolbar/icon_closewindow.png" width="18" height="18" border="0" /></a><div class="clearfloat"></div></div></li>

      </ul>

      </div>

      <div id="menuwrapper">

      <ul id="p7menubar">

      <!-- ADD SIDEBAR - TO COME IN LATER

      <li class="topnav"><a href="javascript:void(0);" class="trigger2"><img src="../../lib/img/headertoolbar/toolbar_icon_sidebar_open.png" width="27" height="13" border="0" /></a></li>

      -->

        <!-- PLANT SELECTOR - NOT FOR DELIVERABLE

      <li class="topnav"><a href="javascript:void(0);" class="trigger">Plant: <strong>SNPP</strong></a>

      <ul>

      <li><a href="javascript:void(0);">Plant Selector</a></li>

      <li><em> </em></li>

      <li><a href="javascript:void(0);">SNPP</a></li>

      <li><a href="javascript:void(0);">BM</a></li>

      <li><a href="javascript:void(0);">SRNP</a></li>

      </ul>

      </li>

      -->

      <li class="topnav"><a href="javascript:void(0);" class="trigger">File</a>

      <ul>

      <li><a href="login.html" target="_blank">New Window</a></li>

      <li><em> </em></li>

      <li><a href="javascript:window.print();" onclick="window.print();">Print</a></li>

      <li><em> </em></li>

      <li><a href="login.html" target="_parent">Log Out</a></li>

      <li><a href="javascript:void(0);" onClick="parent.closeWindow();">Quit VIPER</a></li>

      </ul>

      </li>

        <li class="topnav"><a href="http://designsupport.viperapp.com" target="_blank" class="trigger">Help</a>

        <ul>

      <li><a href="login.html" target="_parent">Reset Connection</a></li>

      <li><em> </em></li>

      <li><a href="http://designsupport.viperapp.com/contact.cfm" target="_blank">Contact Support</a></li>

                                  <li><a href="license.html" target="viperframe">View License</a></li>

      </ul>

      </li>

      </ul>

      <div class="clearfloat"></div>

      </div>

      </div>

      <!-- END P7EXP PULLDOWN MENU -->

      <iframe src="" id="viperframe" name="viperframe" frameborder="0" scrolling="no" width="100%"></iframe>

      <!--<iframe name="viperFrame" id="viperFrame" src="http://devcenter.viperapp.com/VS/ui/screens/plantselections.html" frameborder="0" scrolling="no" width="100%"></iframe>-->

       

      </body>

      </html>

        • 1. Re: AIR Application Sandbox Bridge Issue
          DARTHCYL0N Level 1

          I have been mucking around with it and here is something interesting , if I throw the login the first time and then go in , it runs the ExternalURL command fine

           

          and if I login with the correct login without throwing it , it doesnt work, the only change is that when I type in the wrong login it runs a sandboxbridge command that takes the user back to the login page

           

          if I allow that command to run first then it will run the externalURL fine , if I don't then it won't , how odd is that,

          • 2. Re: AIR Application Sandbox Bridge Issue
            DARTHCYL0N Level 1

            I have tried running another command and it still doesn't run the external URL function, just if it runs my no login command via the sandbox bridge,

            and it is a simple command

             

            here is the javascript it is running on the nologin.

             

            function noLogin(){

            alert('Your login information was incorrect, please try again');

            top.location.href="login.html";

            }

             

            if it runs that over the sandboxbridge it works , if it doesnt then it doesnt.

             

             

            Anyone have any ideas, and I missing something on my iframe  ?