Display different Browser Window titles
In Workspace v18.0 or later, you can configure the Browser component to display the title of the currently-selected View or the currently-selected Page instead of a single title for the entire Browser Window.
How it works
A WindowTitle
type provides the value of the title
property of the BrowserWorkspacePlatformWindowOptions
interface; the string value for this property is deprecated. WindowTitle
has a "type"
property with one of the following string values:
"page-title"
: Uses the title of the active page."view-title"
: Uses the title of the active view."custom"
: If this is used, then there must also be a"value"
property, whose string value is used for the window title.
If the value passed is "page-title"
or "view-title"
, then the window title bar is updated to reflect the title of the selected page or view, whenever the selection changes.
How to do it
For context for these snippets, see the documentation to Customize Browser features.
To display View titles instead of the Window title:
import * as WorkspacePlatform from "@openfin/workspace-platform";
// add the following to your initial workspacePlatform definition
...
title: {
type: "view-title"
},
...
Or to display Page titles:
import * as WorkspacePlatform from "@openfin/workspace-platform";
// add the following to your initial workspacePlatform definition
...
title: {
type: "page-title"
},
...
To display a single-value Window title:
import * as WorkspacePlatform from "@openfin/workspace-platform";
// add the following to your initial workspacePlatform definition
...
title: {
type: "custom",
value: "TITLE_OF_WINDOW"
}
...
Updated 6 months ago