Compare commits

...

6 Commits
3.7 ... 3.7.1

Author SHA1 Message Date
Ajay Ramachandran
b758cbb25f bump version 2021-12-30 17:20:11 -05:00
Ajay Ramachandran
f2be7a9c5b Merge pull request #1113 from CyberPhoenix90/fix_interval_leak
fix leak that was killing performance over long periods
2021-12-30 10:56:42 -05:00
CyberPhoenix90
8763d173bd fix missing semi colon 2021-12-30 15:22:02 +01:00
CyberPhoenix90
07e3117e22 fix leak that was killing performance over long periods 2021-12-30 15:05:09 +01:00
Ajay
12bc10ea1f Make youtube settings in front of skip notice 2021-12-29 00:35:33 -05:00
Ajay
2db1971190 Don't change countdown speed with playback speed
Fix #1067
2021-12-29 00:30:24 -05:00
6 changed files with 12 additions and 15 deletions

View File

@@ -1,7 +1,7 @@
{ {
"name": "__MSG_fullName__", "name": "__MSG_fullName__",
"short_name": "SponsorBlock", "short_name": "SponsorBlock",
"version": "3.7", "version": "3.7.1",
"default_locale": "en", "default_locale": "en",
"description": "__MSG_Description__", "description": "__MSG_Description__",
"homepage_url": "https://sponsor.ajay.app", "homepage_url": "https://sponsor.ajay.app",

View File

@@ -26,6 +26,11 @@
height: 100%; height: 100%;
} }
/* Make sure settings are upfront */
.ytp-settings-menu {
z-index: 6000 !important;
}
/* Preview Bar page hacks */ /* Preview Bar page hacks */
.ytp-tooltip:not(.sponsorCategoryTooltipVisible) .sponsorCategoryTooltip { .ytp-tooltip:not(.sponsorCategoryTooltipVisible) .sponsorCategoryTooltip {

View File

@@ -16,8 +16,6 @@ export interface NoticeProps {
timed?: boolean, timed?: boolean,
idSuffix?: string, idSuffix?: string,
videoSpeed?: () => number,
fadeIn?: boolean, fadeIn?: boolean,
startFaded?: boolean, startFaded?: boolean,
firstColumn?: React.ReactElement, firstColumn?: React.ReactElement,
@@ -51,7 +49,6 @@ export interface NoticeState {
class NoticeComponent extends React.Component<NoticeProps, NoticeState> { class NoticeComponent extends React.Component<NoticeProps, NoticeState> {
countdownInterval: NodeJS.Timeout; countdownInterval: NodeJS.Timeout;
intervalVideoSpeed: number;
idSuffix: string; idSuffix: string;
@@ -259,10 +256,6 @@ class NoticeComponent extends React.Component<NoticeProps, NoticeState> {
const countdownTime = Math.min(this.state.countdownTime - 1, this.state.maxCountdownTime()); 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) { if (countdownTime <= 0) {
//remove this from setInterval //remove this from setInterval
clearInterval(this.countdownInterval); clearInterval(this.countdownInterval);
@@ -325,10 +318,7 @@ class NoticeComponent extends React.Component<NoticeProps, NoticeState> {
setupInterval(): void { setupInterval(): void {
if (this.countdownInterval) clearInterval(this.countdownInterval); if (this.countdownInterval) clearInterval(this.countdownInterval);
const intervalDuration = this.props.videoSpeed ? 1000 / this.props.videoSpeed() : 1000; this.countdownInterval = setInterval(this.countdown.bind(this), 1000);
this.countdownInterval = setInterval(this.countdown.bind(this), intervalDuration);
if (this.props.videoSpeed) this.intervalVideoSpeed = this.props.videoSpeed();
} }
resetCountdown(): void { resetCountdown(): void {

View File

@@ -177,7 +177,6 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
|| (Config.config.noticeVisibilityMode >= NoticeVisbilityMode.FadedForAutoSkip && this.autoSkip)} || (Config.config.noticeVisibilityMode >= NoticeVisbilityMode.FadedForAutoSkip && this.autoSkip)}
timed={true} timed={true}
maxCountdownTime={this.state.maxCountdownTime} maxCountdownTime={this.state.maxCountdownTime}
videoSpeed={() => this.contentContainer().v?.playbackRate}
style={noticeStyle} style={noticeStyle}
biggerCloseButton={this.contentContainer().onMobileYouTube} biggerCloseButton={this.contentContainer().onMobileYouTube}
ref={this.noticeRef} ref={this.noticeRef}

View File

@@ -73,7 +73,7 @@ class SubmissionNoticeComponent extends React.Component<SubmissionNoticeProps, S
idSuffix={this.state.idSuffix} idSuffix={this.state.idSuffix}
ref={this.noticeRef} ref={this.noticeRef}
closeListener={this.cancel.bind(this)} closeListener={this.cancel.bind(this)}
zIndex={50000}> zIndex={5000}>
{/* Text Boxes */} {/* Text Boxes */}
{this.getMessageBoxes()} {this.getMessageBoxes()}

View File

@@ -26,7 +26,10 @@ export default class Utils {
/** Function that can be used to wait for a condition before returning. */ /** Function that can be used to wait for a condition before returning. */
async wait<T>(condition: () => T | false, timeout = 5000, check = 100): Promise<T> { async wait<T>(condition: () => T | false, timeout = 5000, check = 100): Promise<T> {
return await new Promise((resolve, reject) => { return await new Promise((resolve, reject) => {
setTimeout(() => reject("TIMEOUT"), timeout); setTimeout(() => {
clearInterval(interval);
reject("TIMEOUT");
}, timeout);
const intervalCheck = () => { const intervalCheck = () => {
const result = condition(); const result = condition();