mirror of
https://github.com/hcengineering/platform.git
synced 2026-10-16 13:15:24 +02:00
* feat: add optional workspace favicon and identification color Signed-off-by: Ratel-pwn <2448574643@qq.com> * refactor: simplify workspace identification color control Signed-off-by: Ratel-pwn <2448574643@qq.com> * fix: preserve logo size when overlaying favicon color Signed-off-by: Ratel-pwn <2448574643@qq.com> * fix(workbench): separate favicon badge with a transparent cutout Signed-off-by: Ratel-pwn <2448574643@qq.com> * fix(workbench): restore workspace favicon before app startup Signed-off-by: Ratel-pwn <2448574643@qq.com> --------- Signed-off-by: Ratel-pwn <2448574643@qq.com>
39 lines
1.3 KiB
Plaintext
39 lines
1.3 KiB
Plaintext
<!doctype html>
|
|
<html>
|
|
|
|
<head>
|
|
<meta charset="utf8">
|
|
<title>Huly</title>
|
|
<link rel="shortcut icon" data-default-href="/huly/favicon.ico" sizes="any" id="default-favicon">
|
|
<script id="workspace-favicon-bootstrap">
|
|
// Run before the application (and before assigning a fallback URL) during tab restoration.
|
|
// Keep the cache key and PNG validation in sync with presentation/workspaceIdentity.ts.
|
|
;(function () {
|
|
var fallback = document.getElementById('default-favicon')
|
|
try {
|
|
var workspace = location.pathname.match(/^\/workbench\/[^/]+/)
|
|
var icon = workspace && localStorage.getItem('huly.workspace-favicon:' + workspace[0])
|
|
if (icon && icon.length <= 16384 && /^data:image\/png;base64,[A-Za-z0-9+/]+=*$/.test(icon)) {
|
|
var link = document.createElement('link')
|
|
link.id = 'workspace-favicon'
|
|
link.rel = 'icon'
|
|
link.type = 'image/png'
|
|
link.sizes = '32x32'
|
|
link.href = icon
|
|
document.head.appendChild(link)
|
|
return
|
|
}
|
|
} catch (_) {
|
|
// Storage can be unavailable in restricted browsing contexts.
|
|
}
|
|
fallback.href = fallback.dataset.defaultHref
|
|
})()
|
|
</script>
|
|
<noscript><link rel="icon" href="/huly/favicon.ico"></noscript>
|
|
</head>
|
|
|
|
<body style="margin: 0; overflow: hidden;">
|
|
</body>
|
|
|
|
</html>
|