mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-31 21:59:49 +03:00
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -67,10 +67,12 @@ jobs:
|
|||||||
uses: Shopify/upload-to-release@master
|
uses: Shopify/upload-to-release@master
|
||||||
with:
|
with:
|
||||||
args: builds/ChromeExtension.zip
|
args: builds/ChromeExtension.zip
|
||||||
|
name: ChromeExtension.zip
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Upload to release
|
- name: Upload to release
|
||||||
uses: Shopify/upload-to-release@master
|
uses: Shopify/upload-to-release@master
|
||||||
with:
|
with:
|
||||||
args: builds/FirefoxExtension.zip
|
args: builds/FirefoxExtension.zip
|
||||||
|
name: FirefoxExtension.zip
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "__MSG_fullName__",
|
"name": "__MSG_fullName__",
|
||||||
"short_name": "__MSG_Name__",
|
"short_name": "__MSG_Name__",
|
||||||
"version": "1.2.23",
|
"version": "1.2.24",
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"description": "__MSG_Description__",
|
"description": "__MSG_Description__",
|
||||||
"content_scripts": [{
|
"content_scripts": [{
|
||||||
|
|||||||
@@ -88,10 +88,6 @@ chrome.runtime.onInstalled.addListener(function (object) {
|
|||||||
const newUserID = utils.generateUserID();
|
const newUserID = utils.generateUserID();
|
||||||
//save this UUID
|
//save this UUID
|
||||||
Config.config.userID = newUserID;
|
Config.config.userID = newUserID;
|
||||||
|
|
||||||
//TODO: Remove when mobile support is old
|
|
||||||
// Don't show this to new users
|
|
||||||
// Config.config.mobileUpdateShowCount = 1;
|
|
||||||
}
|
}
|
||||||
}, 1500);
|
}, 1500);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ var UUIDs = [];
|
|||||||
var sponsorVideoID = null;
|
var sponsorVideoID = null;
|
||||||
|
|
||||||
// Skips are scheduled to ensure precision.
|
// Skips are scheduled to ensure precision.
|
||||||
// Skips are rescheduled every seeked event.
|
// Skips are rescheduled every seeking event.
|
||||||
// Skips are canceled every seeking event
|
// Skips are canceled every seeking event
|
||||||
var currentSkipSchedule: NodeJS.Timeout = null;
|
var currentSkipSchedule: NodeJS.Timeout = null;
|
||||||
var seekListenerSetUp = false
|
var seekListenerSetUp = false
|
||||||
@@ -35,6 +35,9 @@ var sponsorSkipped = [];
|
|||||||
//the video
|
//the video
|
||||||
var video: HTMLVideoElement;
|
var video: HTMLVideoElement;
|
||||||
|
|
||||||
|
/** The last time this video was seeking to */
|
||||||
|
var lastVideoTime: number = null;
|
||||||
|
|
||||||
var onInvidious;
|
var onInvidious;
|
||||||
var onMobileYouTube;
|
var onMobileYouTube;
|
||||||
|
|
||||||
@@ -476,6 +479,10 @@ function startSponsorSchedule(currentTime?: number): void {
|
|||||||
let forcedSkipTime: number = null;
|
let forcedSkipTime: number = null;
|
||||||
|
|
||||||
if (video.currentTime >= skipTime[0] && video.currentTime < skipTime[1]) {
|
if (video.currentTime >= skipTime[0] && video.currentTime < skipTime[1]) {
|
||||||
|
// Double check that the videoID is correct
|
||||||
|
// TODO: Remove this bug catching if statement when the bug is found
|
||||||
|
let currentVideoID = getYouTubeVideoID(document.URL);
|
||||||
|
if (currentVideoID == sponsorVideoID) {
|
||||||
skipToTime(video, skipInfo.index, skipInfo.array, skipInfo.openNotice);
|
skipToTime(video, skipInfo.index, skipInfo.array, skipInfo.openNotice);
|
||||||
|
|
||||||
if (Config.config.disableAutoSkip) {
|
if (Config.config.disableAutoSkip) {
|
||||||
@@ -483,6 +490,14 @@ function startSponsorSchedule(currentTime?: number): void {
|
|||||||
} else {
|
} else {
|
||||||
forcedSkipTime = skipTime[1];
|
forcedSkipTime = skipTime[1];
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// Something has really gone wrong
|
||||||
|
console.error("[SponsorBlock] The videoID recorded when trying to skip is different than what it should be.");
|
||||||
|
console.error("[SponsorBlock] VideoID recorded: " + sponsorVideoID + ". Actual VideoID: " + currentVideoID);
|
||||||
|
|
||||||
|
// Video ID change occured
|
||||||
|
videoIDChange(currentVideoID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
startSponsorSchedule(forcedSkipTime);
|
startSponsorSchedule(forcedSkipTime);
|
||||||
@@ -533,12 +548,27 @@ function sponsorsLookup(id: string, channelIDPromise?) {
|
|||||||
startSponsorSchedule();
|
startSponsorSchedule();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
video.addEventListener('seeked', () => {
|
video.addEventListener('seeking', () => {
|
||||||
if (!video.paused) startSponsorSchedule();
|
// Reset lastCheckVideoTime
|
||||||
|
lastCheckVideoTime = -1
|
||||||
|
lastCheckTime = 0;
|
||||||
|
|
||||||
|
lastVideoTime = video.currentTime;
|
||||||
|
|
||||||
|
if (!video.paused){
|
||||||
|
startSponsorSchedule();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
video.addEventListener('ratechange', () => startSponsorSchedule());
|
video.addEventListener('ratechange', () => startSponsorSchedule());
|
||||||
video.addEventListener('seeking', cancelSponsorSchedule);
|
video.addEventListener('pause', () => {
|
||||||
video.addEventListener('pause', cancelSponsorSchedule);
|
// Reset lastCheckVideoTime
|
||||||
|
lastCheckVideoTime = -1;
|
||||||
|
lastCheckTime = 0;
|
||||||
|
|
||||||
|
lastVideoTime = video.currentTime;
|
||||||
|
|
||||||
|
cancelSponsorSchedule();
|
||||||
|
});
|
||||||
|
|
||||||
startSponsorSchedule();
|
startSponsorSchedule();
|
||||||
}
|
}
|
||||||
@@ -872,13 +902,6 @@ function skipToTime(v, index, sponsorTimes, openNotice) {
|
|||||||
|
|
||||||
let skipNotice = new SkipNotice(this, currentUUID, Config.config.disableAutoSkip, skipNoticeContentContainer);
|
let skipNotice = new SkipNotice(this, currentUUID, Config.config.disableAutoSkip, skipNoticeContentContainer);
|
||||||
|
|
||||||
//TODO: Remove this when Mobile support is old
|
|
||||||
if (Config.config.mobileUpdateShowCount < 1) {
|
|
||||||
skipNotice.addNoticeInfoMessage(chrome.i18n.getMessage("mobileUpdateInfo"));
|
|
||||||
|
|
||||||
Config.config.mobileUpdateShowCount += 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
//auto-upvote this sponsor
|
//auto-upvote this sponsor
|
||||||
if (Config.config.trackViewCount && !Config.config.disableAutoSkip && Config.config.autoUpvote) {
|
if (Config.config.trackViewCount && !Config.config.disableAutoSkip && Config.config.autoUpvote) {
|
||||||
vote(1, currentUUID, null);
|
vote(1, currentUUID, null);
|
||||||
|
|||||||
Reference in New Issue
Block a user