From 637dcbee00e8356fbfcbe9aefe2202642e5f93d3 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Mon, 26 Oct 2020 00:08:32 -0400 Subject: [PATCH] Fix background colour in popup --- public/popup.html | 6 +----- src/content.ts | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/public/popup.html b/public/popup.html index caae4a40..96db4b1a 100644 --- a/public/popup.html +++ b/public/popup.html @@ -1,5 +1,3 @@ - - __MSG_openPopup__ @@ -137,6 +135,4 @@ - - - \ No newline at end of file + \ No newline at end of file diff --git a/src/content.ts b/src/content.ts index e828e34d..33376741 100644 --- a/src/content.ts +++ b/src/content.ts @@ -1273,9 +1273,19 @@ function openInfoMenu() { sendRequestToCustomServer('GET', chrome.extension.getURL("popup.html"), function(xmlhttp) { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { - var popup = document.createElement("div"); + let popup = document.createElement("div"); popup.id = "sponsorBlockPopupContainer"; - popup.innerHTML = xmlhttp.responseText + + let htmlData = xmlhttp.responseText; + // Hack to replace head data (title, favicon) + htmlData = htmlData.replace(/[\S\s]*<\/head>/gi, ""); + // Hack to replace body tag with div + htmlData = htmlData.replace(/