AboutSupportDeveloper GuideVersion 47.154.100.2
OpenFin JavaScript API
    Preparing search index...

    Class _WindowModule

    Static namespace for OpenFin API methods that interact with the _Window class, available under fin.Window.

    Hierarchy

    • Base
      • _WindowModule
    Index
    • get me(): Identity

      Returns Identity

      me should only be accessed from the fin global (FinApi.me); access through entity classes is not guaranteed to behave sensibly in all calling contexts.

    • Creates a new Window.

      Parameters

      Returns Promise<_Window>

      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 a Window object that represents the current window

      Returns Promise<_Window>

      fin.Window.getCurrent()
      .then(wnd => console.log('current window'))
      .catch(err => console.log(err));
    • Synchronously returns a Window object that represents the current window

      Returns _Window

      const wnd = fin.Window.getCurrentSync();
      const info = await wnd.getInfo();
      console.log(info);
    • Asynchronously returns an API handle for the given Window identity.

      Parameters

      Returns Promise<_Window>

      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.

      Parameters

      Returns _Window

      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' });