Fix config injection with custom HTML/CSS
This commit is contained in:
parent
c504295581
commit
b4c945f3c7
1 changed files with 3 additions and 2 deletions
|
@ -382,8 +382,9 @@ class ClientHtml {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static addServerConfig (htmlStringPage: string, serverConfig: HTMLServerConfig) {
|
private static addServerConfig (htmlStringPage: string, serverConfig: HTMLServerConfig) {
|
||||||
const serverConfigString = JSON.stringify(serverConfig)
|
// Stringify the JSON object, and then stringify the string object so we can inject it into the HTML
|
||||||
const configScriptTag = `<script type="application/javascript">window.PeerTubeServerConfig = '${serverConfigString}'</script>`
|
const serverConfigString = JSON.stringify(JSON.stringify(serverConfig))
|
||||||
|
const configScriptTag = `<script type="application/javascript">window.PeerTubeServerConfig = ${serverConfigString}</script>`
|
||||||
|
|
||||||
return htmlStringPage.replace(CUSTOM_HTML_TAG_COMMENTS.SERVER_CONFIG, configScriptTag)
|
return htmlStringPage.replace(CUSTOM_HTML_TAG_COMMENTS.SERVER_CONFIG, configScriptTag)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue