This content has been marked as final. Show 6 replies
Use windowOptions.systemChrome = air.NativeWindowSystemChrome.NONE
var windowOptions = new air.NativeWindowInitOptions()
windowOptions.systemChrome = air.NativeWindowSystemChrome.NONE
//Create the window
var htmlLoader = air.HTMLLoader.createRootWindow(false,windowOptions, false)
Yeah, i know that, but i am somehow not able to build a sandboxBridge between those two windows when using HTMLLoaders createRootWindow.. i only managed that with window.open, but i need to build up an Bridge between both windows and must be able to set the systemChrome, but i'm not able to manage that :-/
I just have read this in http://help.adobe.com/en_US/AIR/1.5/devappshtml/WS5b3ccc516d4fbf351e63e3d118666ade46-7f08. html :
"If you use the HTMLLoader class createRootWindow() function to create a window, the new window is not a child of the document from which createRootWindow() is called. Thus, you cannot create a sandbox bridge from the calling window to non-application content loaded into the new window. Instead, you must use load an intermediate page in the new window that itself uses frames to load the child document. You can then establish the bridge from the parent document of the new window to the child document loaded into the frame."
Is there really no way in an html/js-AIR Application to "communicate" between the window, that calls createRootWindow(); and the one that gets opened? Is it in any way possible to create a multi window app using HTMLLoader? or another way? Or will i be not able to create a fine multiple window app that way?
I ran into those issues too and I am not claiming my way is good, but what we did was to hide an app window that opens several objects, one of which was a windows object. This custom window object makes windows, keeps track of them and puts a reference to the parent object into every window created so I can reference back via it. So now any window can call the window object and get a reference to another window and call methods inside of it or change DOM in another window.
It is convoluted at best, but it works.
When using createRootWindow(), you can have the parent window set a reference to itself after creating the child window (as long as the root content of both windows is from the same domain):
var childHTMLObject = air.HTMLLoader.createRootWindow(false,windowOptions, false)
childHTMLObject.window.parent = window;
Communicating between application and non-application content is another issue. Unfortunately, you can't create a sandbox bridge directly between the "parent" and the new window created with createRootWindow(), but there is a workaround, which is described in the docs you cite.
To use a sandboxBridge in this case, your new window has to load an HTML page from your application that contains a frame or iframe. The root content of this window will be in the application sandbox and can communicate with other application windows. The frame is in a security sandbox based on its domain of origin. You create a sandbox bridge between the root content of the child window and the frame content to allow communication between the application and the non-application content.
@kstephens Having a window manager object in a complex app doesn't strike me as particularly convoluted, but note that you can create the normal HTML properties like parent and opener even when AIR doesn't do it for you automatically.
WOW, thats alot of input, thank you very much! I'll check all that, when i'm continuing my work on monday. A real blast getting that much of help, thank you very much! I'll mark messages as answer as soon i'm done.