From 2564d97e0d77340ede0031936082cc37d6f8fd79 Mon Sep 17 00:00:00 2001 From: kontrollanten <6680299+kontrollanten@users.noreply.github.com> Date: Tue, 8 Dec 2020 14:51:51 +0100 Subject: [PATCH] video-embed: inject custom CSS closes #3420 --- client/src/standalone/videos/embed.html | 1 + client/webpack/webpack.video-embed.js | 10 +++++++++- server/lib/client-html.ts | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/client/src/standalone/videos/embed.html b/client/src/standalone/videos/embed.html index 908aad940..17029ec41 100644 --- a/client/src/standalone/videos/embed.html +++ b/client/src/standalone/videos/embed.html @@ -8,6 +8,7 @@ + diff --git a/client/webpack/webpack.video-embed.js b/client/webpack/webpack.video-embed.js index 70141527c..d578443fe 100644 --- a/client/webpack/webpack.video-embed.js +++ b/client/webpack/webpack.video-embed.js @@ -122,7 +122,15 @@ module.exports = function () { title: 'PeerTube', chunksSortMode: 'auto', inject: 'body', - chunks: ['video-embed'] + chunks: ['video-embed'], + minify: { + collapseWhitespace: true, + removeComments: false, + removeRedundantAttributes: true, + removeScriptTypeAttributes: true, + removeStyleLinkTypeAttributes: true, + useShortDoctype: true + } }), new HtmlWebpackPlugin({ diff --git a/server/lib/client-html.ts b/server/lib/client-html.ts index 43585c591..6a457a711 100644 --- a/server/lib/client-html.ts +++ b/server/lib/client-html.ts @@ -210,6 +210,7 @@ class ClientHtml { let html = buffer.toString() html = await ClientHtml.addAsyncPluginCSS(html) + html = ClientHtml.addCustomCSS(html) ClientHtml.htmlCache[path] = html