mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-06 19:47:04 +03:00
Copy styles over to popup
This commit is contained in:
@@ -441,3 +441,13 @@ function forwardClickEvents(sendMessage: (request: Message) => Promise<MessageRe
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Copy over styles from parent window
|
||||||
|
window.addEventListener("message", async (e): Promise<void> => {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user