Options
All
  • Public
  • Public/Protected
  • All
Menu

Factory for wrapping browser windows and global operations.

Hierarchy

  • BrowserWindowFactory

Index

Methods

createWindow

  • Create a new browser window.

    import * as WorkspacePlatform from '@openfin/workspace-platform';

    const workspacePlatform = WorkspacePlatform.getCurrentSync();
    const layout = {
    content: [
    {
    type: 'stack',
    content: [
    {
    type: 'component',
    componentName: 'view',
    componentState: {
    name: 'myViewName',
    url: 'http://google.com'
    }
    }
    ]
    }
    ]
    };
    const page = {
    title: 'myPageTitle',
    pageId: 'myPageId',
    layout
    };
    const options: BrowserCreateWindowRequest = {
    workspacePlatform {
    pages: [page],
    title: 'My Window Title',
    favicon: 'https://google.com/favicon.ico'
    }
    };
    const window = await workspacePlatform.Browser.createWindow(options);

    Parameters

    Returns Promise<BrowserWindowModule>

getAllAttachedPages

  • Get a list of all pages that are attached to any running browser window.

    import * as WorkspacePlatform from '@openfin/workspace-platform';

    const workspacePlatform = WorkspacePlatform.getCurrentSync();
    const attachedPages = await workspacePlatform.Browser.getAllAttachedPages();

    Returns Promise<AttachedPage[]>

getAllWindows

  • Get all the Browser Windows that are running in the Workspace Platform.

    import * as WorkspacePlatform from '@openfin/workspace-platform';

    const workspacePlatform = WorkspacePlatform.getCurrentSync();
    const windows = await workspacePlatform.Browser.getAllWindows();

    Returns Promise<BrowserWindowModule[]>

getLastFocusedWindow

  • getLastFocusedWindow(): Promise<Identity>
  • Get the identity of the last focused Browser window.

    import * as WorkspacePlatform from '@openfin/workspace-platform';

    const workspacePlatform = WorkspacePlatform.getCurrentSync();
    const windowIdentity = await workspacePlatform.Browser.getLastFocusedWindow();

    Returns Promise<Identity>

getUniquePageTitle

  • getUniquePageTitle(title?: string): Promise<string>
  • Get a unique title for a page.

    import * as WorkspacePlatform from '@openfin/workspace-platform';

    const workspacePlatform = WorkspacePlatform.getCurrentSync();
    const uniqueTitle = await workspacePlatform.Browser.getUniquePageTitle('myTitle');

    Parameters

    • Optional title: string

      a prefix for the title.

    Returns Promise<string>

wrapSync

  • Synchronously returns a Browser Window object that represents an existing window

    Parameters

    • identity: Identity

      of the window

    Returns BrowserWindowModule

Generated using TypeDoc