diff --git a/src/webui/www/private/views/rss.html b/src/webui/www/private/views/rss.html index 1adf741df..7088f6f8f 100644 --- a/src/webui/www/private/views/rss.html +++ b/src/webui/www/private/views/rss.html @@ -494,10 +494,18 @@ detailsView.append(divElement); } - // Place in iframe with sandbox attribute to prevent js execution - const torrentDescription = document.createRange().createContextualFragment(''); - $("rssDetailsView").append(torrentDescription); - document.getElementById("rssDescription").srcdoc = `${article.description}`; + const articleDescription = article.description; + if (articleDescription !== undefined) { + const rootColor = document.documentElement.classList.contains("dark") ? "class='dark'" : ""; + + // Place in iframe with sandbox attribute to prevent js execution + const iframeElement = document.createElement("iframe"); + iframeElement.id = "rssDescription"; + iframeElement.sandbox = "allow-same-origin"; // allowed to get parent css + iframeElement.srcdoc = `${articleDescription}`; + + detailsView.append(iframeElement); + } }; const updateRssFeedList = () => {