mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 02:00:43 +00:00
20 lines
407 B
JavaScript
20 lines
407 B
JavaScript
|
||
const STANDALONE_TITLE = 'Weave Scope';
|
||
const STANDALONE = document.title === STANDALONE_TITLE;
|
||
const SEPARATOR = ' – ';
|
||
|
||
export function setDocumentTitle(title) {
|
||
if (!STANDALONE) {
|
||
return;
|
||
}
|
||
if (title) {
|
||
document.title = [STANDALONE_TITLE, title].join(SEPARATOR);
|
||
} else {
|
||
document.title = STANDALONE_TITLE;
|
||
}
|
||
}
|
||
|
||
export function resetDocumentTitle() {
|
||
setDocumentTitle(null);
|
||
}
|