The browser window factory for the Workspace Platform.
The storage API for the Workspace Platform.
Theme API for the Workspace Platform.
Launch a browser snapshot that contains windows with pages.
the browser snapshot to launch or a url or filepath to retrieve a JSON snapshot.
Optional
options: ApplySnapshotOptionsApplies the given workspace to the user's desktop. Makes that workspace the active workspace.
the workspace to apply to the desktop and set as the current active workspace.
Optional
options: ApplyWorkspaceOptionstrue if the workspace was applied, false if the workspace was not applied.
Brief example of how to apply a workspace, currently stored in storage, to the desktop.
const workspacePlatform = getCurrentSync();
// This assumes that there is at least one workspace in storage.
const allWorkspaces = await workspacePlatform.Storage.getWorkspaces();
// Apply the first workspace in storage to the desktop.
await workspacePlatform.applyWorkspace(allWorkspaces[0], {
// Customize the behavior of the applyWorkspace call.
skipPrompt: false,
applySnapshotOptions: {
closeExistingWindows: false,
closeSnapshotWindows: false,
skipOutOfBoundsCheck: false,
},
});
Get a snapshot that contains browser windows with pages.
Launch an application.
the launch app request.
This method is deprecated. It is recommended to use createView or createWindow instead.
import * as WorkspacePlatform from '@openfin/workspace-platform';
const workspacePlatform = WorkspacePlatform.getCurrentSync();
const req = {
app: {
appId: 'myAppId',
title: 'appTitle',
manifest: 'http://localhost/app.json',
manifestType: AppManifestType.Manifest,
icons:[
{
icon: "https://cdn.openfin.co/demos/notifications/generator/images/icon-blue.png",
src: "https://cdn.openfin.co/demos/notifications/generator/images/icon-blue.png",
type: "ico",
},
]
}
}
workspacePlatform.launchApp(req);
Sets the workspace as the current active workspace. Does not apply the workspace to the user's desktop.
the workspace to set as current active workspace.
Controller for a Workspace Platform.