Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    SmartClient on Adobe AIR

    A few pointers or those interested in deploying their SmartClient-based applications on the AIR platform...

    Adobe AIR uses restricts certain APIs SmartClient relies on in the application sandbox. These include things like use of eval(), setTimeout(), new Function(), etc - basic building blocks that any Ajax framework would rely on. This makes sense because unlike a browser, the AIR sandbox exposes a lot more functionality to the runtime that could be abused, though overall I think it would have been better if they had gone with more of a perl taint model....

    There's a lengthy FAQ on adobe.com about their security restrictions: http://labs.adobe.com/wiki/index.php...L_Security_FAQ. The upshot is that you need to make an iframe, load SmartClient in there, and then export whatever additional functionality you require into the iframe, typically in a service-style pattern rather than a generic mechanism that, say, allows the code in the iframe to write arbitrary files to disk.

    We've been playing around with this for a while and since there were people asking about it, decided to post our own "AIR Browser" application which uses this iframe pattern to create a very crude browser that you can point at any URL and have the contents be loaded in an AIR iframe.

    The example is attached to this post - to use, simply download the 1.0 version of the AIR SDK and unzip this in the top-level AdobeAIRSDK folder. Then run the 'runBrowser.bat' to start up the browser. Other than this bootstrap, all relevant files are under the apps/ directory and are pretty self explanatory.

    The pattern used in this application is the same one that you would use to wrap a SmartClient-based web application into an installable AIR application.

    Note that if you're using SmartClient 6.0 or older, you will also need to add the following patch to the html file that loads SmartClient modules to have it recognize the browser string as a supported browser. Place the following code right before the script include that loads the skin:

    Code:
    <SCRIPT>
    isc.Browser.isAIR = (navigator.userAgent.indexOf("AdobeAIR") != -1);
    if (isc.Browser.isAIR) {
        isc.Browser.isSafari = true;
        isc.Browser.isDOM = true;
        isc.Browser.safariVersion = 530;
        isc.Browser.isSupported = true;
    }
    </SCRIPT>
    Attached Files
Working...
X