mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-13 15:07:02 +03:00
Add support for userstyles in the popup
It takes userstyles from stylus or enhancer for YouTube and copies them to the popup in an iframe
This commit is contained in:
@@ -72,6 +72,12 @@ window.addEventListener("message", async (e): Promise<void> => {
|
||||
if (e.source !== window.parent) return;
|
||||
if (e.origin.endsWith('.youtube.com')) {
|
||||
allowPopup = true;
|
||||
|
||||
if (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