added document[browser] to help styling
Massimo Melina committed
Oct 19, 2025 at 15:54 UTC
be91ade1dad1847cea6dfbac32bc06488ea3a850
1 file changed
+2
-1
src/serveGuiFiles.ts
+2
-1
@@ -12,7 +12,7 @@ import { ApiError } from './apiMiddleware'
12
import { join, extname } from 'path'
13
import {
14
CFG, debounceAsync, formatBytes, FRONTEND_OPTIONS, isPrimitive, newObj, objSameKeys, onlyTruthy, parseFile,
15
- enforceStarting, statWithTimeout
15
+ enforceStarting, statWithTimeout, shortenAgent
16
} from './misc'
17
import { favicon, title } from './adminApis'
18
import { getAllSections, getSection } from './customHtml'
@@ -118,6 +118,7 @@ async function treatIndex(ctx: Koa.Context, filesUri: string, body: string) {
118
lang
119
}, null, 4).replace(/<(\/script)/g, '<"+"$1') /*avoid breaking our script container*/}
120
document.documentElement.setAttribute('ver', HFS.VERSION.split('-')[0])
121
+ document.documentElement.setAttribute('browser', ${JSON.stringify(shortenAgent(ctx.get('user-agent')))})
122
</script>
123
${isFrontend && `
124
<title>${title.get()}</title>