Provides access to the OpenFin representation of the current code context (usually a document
such as a View or Window), as well as to the current Interop
context.
Useful for debugging in the devtools console, where this will intelligently type itself based on the context in which the devtools panel was opened.
Creates a new Window.
Window creation options
async function createWindow() {
const winOption = {
name:'child',
defaultWidth: 300,
defaultHeight: 300,
url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.create.html',
frame: true,
autoShow: true
};
return await fin.Window.create(winOption);
}
createWindow().then(() => console.log('Window is created')).catch(err => console.log(err));
Asynchronously returns an API handle for the given Window identity.
Wrapping a Window identity that does not yet exist will not throw an error, and instead returns a stub object that cannot yet perform rendering tasks. This can be useful for plumbing eventing for a Window throughout its entire lifecycle.
async function createWin() {
const app = await fin.Application.start({
name: 'myApp',
uuid: 'app-1',
url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.wrap.html',
autoShow: true
});
return await app.getWindow();
}
createWin().then(() => fin.Window.wrap({ uuid: 'app-1', name: 'myApp' }))
.then(win => console.log('wrapped window'))
.catch(err => console.log(err));
Synchronously returns an API handle for the given Window identity.
Wrapping a Window identity that does not yet exist will not throw an error, and instead returns a stub object that cannot yet perform rendering tasks. This can be useful for plumbing eventing for a Window throughout its entire lifecycle.
async function createWin() {
const app = await fin.Application.start({
name: 'myApp',
uuid: 'app-1',
url: 'https://cdn.openfin.co/docs/javascript/stable/tutorial-Window.wrapSync.html',
autoShow: true
});
return await app.getWindow();
}
await createWin();
let win = fin.Window.wrapSync({ uuid: 'app-1', name: 'myApp' });
Static namespace for OpenFin API methods that interact with the Window class, available under
fin.Window
.