Skip to main content

Create a custom default Page

In HERE Core UI Components v19.0 or later, you can create a custom default page that users see when they add a page in Browser. By default this page contains a single view, but you can override this configuration with the layout and views your workflow requires.

How it works​

An addDefaultPage method is available for the WorkspacePlatformProvider interface. You override this method to provide the details of the default page your environment requires.

See the API reference for addDefaultPage.

note

Through HERE Core UI Components 45.1.x, AddDefaultPagePayload included newPageUrl. Starting in 45.2.0, that field is not part of the payload. The payload contains identity, page, and an optional origin. Overrides that read payload.newPageUrl must read workspacePlatform.newPageUrl from the target window's options instead. Window options workspacePlatform.newPageUrl and workspacePlatform.newTabUrl are unchanged.

const { workspacePlatform } = await fin.Window.wrapSync(payload.identity).getOptions();
const newPageUrl = workspacePlatform?.newPageUrl || undefined;

In this snippet, payload is the argument passed to addDefaultPage (req in the sample below).

How to do it​

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

const overrideCallback: WorkspacePlatform.WorkspacePlatformOverrideCallback = async (
WorkspacePlatformProvider
) =>
{
class Override extends WorkspacePlatformProvider
{
addDefaultPage = async (req: AddDefaultPagePayload): Promise<void> =>
{
// Could alter the payload or run your own custom logic and not call super
const decoratedPayload = decorateAddDefaultPagePayload(req);
return super.addDefaultPage(decoratedPayload);
};
}
return new Override();
};
await WorkspacePlatform.init(
{
browser:
{
title: "My HERE Core UI Platform"
},
overrideCallback
}
);

Table of Contents