mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-07 20:17:05 +03:00
Fix background colour in popup
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
<html>
|
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>__MSG_openPopup__</title>
|
<title>__MSG_openPopup__</title>
|
||||||
<link id="sponsorBlockPopupFont" rel="stylesheet" type="text/css" href="/libs/Source+Sans+Pro.css">
|
<link id="sponsorBlockPopupFont" rel="stylesheet" type="text/css" href="/libs/Source+Sans+Pro.css">
|
||||||
@@ -138,5 +136,3 @@
|
|||||||
<script src="./js/vendor.js" async></script>
|
<script src="./js/vendor.js" async></script>
|
||||||
<script src="./js/popup.js" async></script>
|
<script src="./js/popup.js" async></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
|
||||||
@@ -1273,9 +1273,19 @@ function openInfoMenu() {
|
|||||||
|
|
||||||
sendRequestToCustomServer('GET', chrome.extension.getURL("popup.html"), function(xmlhttp) {
|
sendRequestToCustomServer('GET', chrome.extension.getURL("popup.html"), function(xmlhttp) {
|
||||||
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
|
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
|
||||||
var popup = document.createElement("div");
|
let popup = document.createElement("div");
|
||||||
popup.id = "sponsorBlockPopupContainer";
|
popup.id = "sponsorBlockPopupContainer";
|
||||||
popup.innerHTML = xmlhttp.responseText
|
|
||||||
|
let htmlData = xmlhttp.responseText;
|
||||||
|
// Hack to replace head data (title, favicon)
|
||||||
|
htmlData = htmlData.replace(/<head>[\S\s]*<\/head>/gi, "");
|
||||||
|
// Hack to replace body tag with div
|
||||||
|
htmlData = htmlData.replace(/<body/gi, "<div");
|
||||||
|
htmlData = htmlData.replace(/<\/body/gi, "</div");
|
||||||
|
|
||||||
|
console.log(htmlData)
|
||||||
|
|
||||||
|
popup.innerHTML = htmlData;
|
||||||
|
|
||||||
//close button
|
//close button
|
||||||
let closeButton = document.createElement("div");
|
let closeButton = document.createElement("div");
|
||||||
@@ -1313,10 +1323,6 @@ function openInfoMenu() {
|
|||||||
check.src = chrome.extension.getURL("icons/check.svg");
|
check.src = chrome.extension.getURL("icons/check.svg");
|
||||||
check.src = chrome.extension.getURL("icons/thumb.svg");
|
check.src = chrome.extension.getURL("icons/thumb.svg");
|
||||||
|
|
||||||
//remove the style sheet and font that are not necessary
|
|
||||||
popup.querySelector("#sponsorBlockPopupFont").remove();
|
|
||||||
popup.querySelector("#sponsorBlockStyleSheet").remove();
|
|
||||||
|
|
||||||
parentNode.insertBefore(popup, parentNode.firstChild);
|
parentNode.insertBefore(popup, parentNode.firstChild);
|
||||||
|
|
||||||
//run the popup init script
|
//run the popup init script
|
||||||
|
|||||||
Reference in New Issue
Block a user