From 4330d5a7265b19e7e773a038ccda7ec909fa50f9 Mon Sep 17 00:00:00 2001 From: Ajay Date: Wed, 4 Jun 2025 00:57:25 -0400 Subject: [PATCH] Copy styles over to popup --- src/popup/PopupComponent.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/popup/PopupComponent.tsx b/src/popup/PopupComponent.tsx index 2357f816..02798c80 100644 --- a/src/popup/PopupComponent.tsx +++ b/src/popup/PopupComponent.tsx @@ -440,4 +440,14 @@ function forwardClickEvents(sendMessage: (request: Message) => Promise => { + if (e.source !== window.parent) return; + if (e.origin.endsWith(".youtube.com") && e.data && e.data?.type === "style") { + const style = document.createElement("style"); + style.textContent = e.data.css; + document.head.appendChild(style); + } +}); \ No newline at end of file