diff --git a/manifest/manifest.json b/manifest/manifest.json index be6129f3..fcb22641 100644 --- a/manifest/manifest.json +++ b/manifest/manifest.json @@ -1,7 +1,7 @@ { "name": "__MSG_fullName__", "short_name": "SponsorBlock", - "version": "3.7", + "version": "3.7.1", "default_locale": "en", "description": "__MSG_Description__", "homepage_url": "https://sponsor.ajay.app", diff --git a/public/content.css b/public/content.css index bcc755ea..b9f19080 100644 --- a/public/content.css +++ b/public/content.css @@ -26,6 +26,11 @@ height: 100%; } +/* Make sure settings are upfront */ +.ytp-settings-menu { + z-index: 6000 !important; +} + /* Preview Bar page hacks */ .ytp-tooltip:not(.sponsorCategoryTooltipVisible) .sponsorCategoryTooltip { diff --git a/src/components/NoticeComponent.tsx b/src/components/NoticeComponent.tsx index d7307bca..c3128e72 100644 --- a/src/components/NoticeComponent.tsx +++ b/src/components/NoticeComponent.tsx @@ -16,8 +16,6 @@ export interface NoticeProps { timed?: boolean, idSuffix?: string, - videoSpeed?: () => number, - fadeIn?: boolean, startFaded?: boolean, firstColumn?: React.ReactElement, @@ -51,7 +49,6 @@ export interface NoticeState { class NoticeComponent extends React.Component { countdownInterval: NodeJS.Timeout; - intervalVideoSpeed: number; idSuffix: string; @@ -259,10 +256,6 @@ class NoticeComponent extends React.Component { const countdownTime = Math.min(this.state.countdownTime - 1, this.state.maxCountdownTime()); - if (this.props.videoSpeed && this.intervalVideoSpeed != this.props.videoSpeed()) { - this.setupInterval(); - } - if (countdownTime <= 0) { //remove this from setInterval clearInterval(this.countdownInterval); @@ -325,10 +318,7 @@ class NoticeComponent extends React.Component { setupInterval(): void { if (this.countdownInterval) clearInterval(this.countdownInterval); - const intervalDuration = this.props.videoSpeed ? 1000 / this.props.videoSpeed() : 1000; - this.countdownInterval = setInterval(this.countdown.bind(this), intervalDuration); - - if (this.props.videoSpeed) this.intervalVideoSpeed = this.props.videoSpeed(); + this.countdownInterval = setInterval(this.countdown.bind(this), 1000); } resetCountdown(): void { diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index 002218b6..da771853 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -177,7 +177,6 @@ class SkipNoticeComponent extends React.Component= NoticeVisbilityMode.FadedForAutoSkip && this.autoSkip)} timed={true} maxCountdownTime={this.state.maxCountdownTime} - videoSpeed={() => this.contentContainer().v?.playbackRate} style={noticeStyle} biggerCloseButton={this.contentContainer().onMobileYouTube} ref={this.noticeRef} diff --git a/src/components/SubmissionNoticeComponent.tsx b/src/components/SubmissionNoticeComponent.tsx index 5b5bd005..82aa0cca 100644 --- a/src/components/SubmissionNoticeComponent.tsx +++ b/src/components/SubmissionNoticeComponent.tsx @@ -73,7 +73,7 @@ class SubmissionNoticeComponent extends React.Component + zIndex={5000}> {/* Text Boxes */} {this.getMessageBoxes()} diff --git a/src/popup.ts b/src/popup.ts index 84607e15..14d22dd8 100644 --- a/src/popup.ts +++ b/src/popup.ts @@ -739,7 +739,7 @@ async function runThePopup(messageListener?: MessageListener): Promise { */ function getFormattedHours(minutes) { minutes = Math.round(minutes * 10) / 10; - const days = Math.floor(minutes / 3600); + const days = Math.floor(minutes / 1440); const hours = Math.floor(minutes / 60) % 24; return (days > 0 ? days + chrome.i18n.getMessage("dayAbbreviation") + " " : "") + (hours > 0 ? hours + chrome.i18n.getMessage("hourAbbreviation") + " " : "") + (minutes % 60).toFixed(1); } diff --git a/src/utils.ts b/src/utils.ts index 81be9488..7912c184 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -27,7 +27,10 @@ export default class Utils { /** Function that can be used to wait for a condition before returning. */ async wait(condition: () => T | false, timeout = 5000, check = 100): Promise { return await new Promise((resolve, reject) => { - setTimeout(() => reject("TIMEOUT"), timeout); + setTimeout(() => { + clearInterval(interval); + reject("TIMEOUT"); + }, timeout); const intervalCheck = () => { const result = condition();