mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-11 14:07:13 +03:00
Fix popup width when embedded in page
This commit is contained in:
@@ -100,6 +100,10 @@
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
#sponsorBlockPopupContainer iframe {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/*
|
||||
* Disable popup max height when displayed in-page (content.ts)
|
||||
*/
|
||||
@@ -110,7 +114,7 @@
|
||||
/*
|
||||
* Disable fixed popup width when displayed in-page (content.ts)
|
||||
*/
|
||||
#sponsorBlockPopupContainer #sponsorBlockPopupBody {
|
||||
#sponsorBlockPopupBody.is-embedded {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
|
||||
@@ -75,6 +75,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
||||
const PageElements: PageElements = {};
|
||||
|
||||
[
|
||||
"sponsorBlockPopupBody",
|
||||
"sponsorblockPopup",
|
||||
"sponsorStart",
|
||||
// Top toggles
|
||||
@@ -132,7 +133,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
||||
|
||||
getSegmentsFromContentScript(false);
|
||||
await utils.wait(() => Config.config !== null && allowPopup, 5000, 5);
|
||||
document.querySelector("body").style.removeProperty("visibility");
|
||||
PageElements.sponsorBlockPopupBody.style.removeProperty("visibility");
|
||||
if (!Config.configSyncListeners.includes(contentConfigUpdateListener)) {
|
||||
Config.configSyncListeners.push(contentConfigUpdateListener);
|
||||
}
|
||||
@@ -145,6 +146,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
||||
|
||||
if (window !== window.top) {
|
||||
PageElements.sbCloseButton.classList.remove("hidden");
|
||||
PageElements.sponsorBlockPopupBody.classList.add("is-embedded");
|
||||
}
|
||||
|
||||
// Hide donate button if wanted (Safari, or user choice)
|
||||
|
||||
Reference in New Issue
Block a user