4 Replies Latest reply on Mar 6, 2009 2:31 AM by jasoncowley

    Using AIR as a Custom Web Browser

    jasoncowley
      Hi,

      I am trying to use Adobe AIR as a web browser that is locked down to just our application that I can deploy to our clients. However, I have run across a few problems, the first one is to do with popup windows in the application.

      For example, if I create a new named window using JavaScript like this:

      window.open('', 'foo');

      Then if I later try to submit an HTML form with foo as the target window, I get a second popup window appearing. The call to window.open appears to ignore the window name. Is there something I need to do to enable the standard behaviour in this case so that the original popup window is used as the target of the form submission?

      Also, is there a way to disable popup blocking if a popup is generated on page load, rather than as a direct result of a user action?

      Thanks,

      Jason
        • 1. Re: Using AIR as a Custom Web Browser
          Sanctor
          In custom HTMLHost in overrided function createWindow try to check names of all open windows and return as result HTMLLoader of 'foo' window.
          • 2. Re: Using AIR as a Custom Web Browser
            jasoncowley Level 1
            Thanks for the quick response.

            I hope this isn't a stupid question, but how can I get the names of open windows, and the name of the window currently being opened in my overridden createWindow function?

            Thanks,

            Jason
            • 3. Re: Using AIR as a Custom Web Browser
              Joe ... Ward Level 4
              @Jason,

              Setting the target in a link or a form should just work. Are both the caller and the target in the same domain? I wouldn't expect that a window in a remote domain would be able to change the location of a window in the application sandbox.

              @Sanctor,
              You don't have access to the target parameter when overriding createWindow(), so your proposed solution wouldn't work (but shouldn't be needed anyway).
              • 4. Re: Using AIR as a Custom Web Browser
                jasoncowley Level 1
                quote:

                @Jason,

                Setting the target in a link or a form should just work. Are both the caller and the target in the same domain? I wouldn't expect that a window in a remote domain would be able to change the location of a window in the application sandbox.


                Yes, both the caller and the target are in the same domain.

                I have discovered that it works correctly if I do not use a custom HTMLHost class. I was originally using a very basic implementation of the HTMLHost class that I copied from the documentation to try to fix another problem I was having. Could this be a general problem with subclassing HTMLHost?

                Thanks,

                Jason