The identity of the browser window.
Underlying OpenFin window Controller.
Attach a page to a browser window. If a page with same id or title is attached to an existing browser window, an error will be thrown.
import * as WorkspacePlatform from '@openfin/workspace-platform-5.0';
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
};
// assume a browser window already exists
const windows = await workspacePlatform.Browser.getAllWindows();
await windows[0].addPage(page);
the attach page to a browser window.
Get a page that is attached to the browser window.
import * as WorkspacePlatform from '@openfin/workspace-platform-5.0';
const workspacePlatform = WorkspacePlatform.getCurrentSync();
// assume a browser window already exists
const windows = await workspacePlatform.Browser.getAllWindows();
const page = await windows[0].getPage('MyPageId');
the id of the page to get.
Return all the pages that are attached to a browser window.
import * as WorkspacePlatform from '@openfin/workspace-platform-5.0';
const workspacePlatform = WorkspacePlatform.getCurrentSync();
// assume a browser window already exists
const windows = await workspacePlatform.Browser.getAllWindows();
const pages = await windows[0].getPages();
Remove an attached page from the browser window.
import * as WorkspacePlatform from '@openfin/workspace-platform-5.0';
const workspacePlatform = WorkspacePlatform.getCurrentSync();
// assume a browser window already exists
const windows = await workspacePlatform.Browser.getAllWindows();
await windows[0].removePage('myPageId');
the id of the attached page to remove from the browser window.
Reorder pages attached to the browser window.
import * as WorkspacePlatform from '@openfin/workspace-platform-5.0';
const workspacePlatform = WorkspacePlatform.getCurrentSync();
// assume a browser window already exists and has three pages in it
const windows = await workspacePlatform.Browser.getAllWindows();
await windows[0].reorderPages(['myPageId2', 'myPageId1', 'myPageId3']);
the reorder pages request.
Set the active page for the browser window.
import * as WorkspacePlatform from '@openfin/workspace-platform-5.0';
const workspacePlatform = WorkspacePlatform.getCurrentSync();
// assume a browser window already exists
const windows = await workspacePlatform.Browser.getAllWindows();
await windows[0].setActivePage('MyPageId');
the id of the attached page to set as active.
Update a page in which is attached to the browser window.
import * as WorkspacePlatform from '@openfin/workspace-platform-5.0';
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
};
// assume a browser window already exists
const windows = await workspacePlatform.Browser.getAllWindows();
const req = {
pageId: 'myPageId',
page
};
await windows[0].updatePage(req);
the update request.
Generated using TypeDoc
Controller for interacting with a browser window.