Skip to content

Commit

Permalink
Load customCSS content for the notification monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
FMaz008 committed Nov 13, 2024
1 parent fd4d805 commit 8afd1f8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions page/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ var feedPaused = false;

const broadcastChannel = new BroadcastChannel("VineHelperChannel");

//Load custom CSS
function loadStyleSheetContent(content, path = "injected") {
if (content != "") {
const style = document.createElement("style");
style.innerHTML = "/*" + path + "*/\n" + content;
document.head.appendChild(style);
}
}

const handleReportClick = (e) => {
e.preventDefault(); // Prevent the default click behavior
report(e.target.dataset.asin);
Expand Down Expand Up @@ -182,6 +191,10 @@ async function init() {
setLocale(vineCountry);
loadedTpl = await Tpl.loadFile("/view/notification_monitor.html");

if (Settings.get("general.customCSS")) {
loadStyleSheetContent(Settings.get("general.customCSS"));
}

if (!Settings.get("notification.active")) {
document.getElementById("status").innerHTML =
"<strong>Notifications disabled</strong> You need to enable the notifications for this window to work.";
Expand Down

0 comments on commit 8afd1f8

Please sign in to comment.