mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-23 16:08:29 +03:00
Compare commits
29 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2e49bb73c5 | ||
|
|
5158020293 | ||
|
|
feaf80ad1e | ||
|
|
7fbd89159e | ||
|
|
716861da18 | ||
|
|
d0a34d423c | ||
|
|
adfba72f19 | ||
|
|
f00337c376 | ||
|
|
737a023b65 | ||
|
|
5551344355 | ||
|
|
07f64382fb | ||
|
|
1c7cde2a19 | ||
|
|
8510a7f3d8 | ||
|
|
db60b11a17 | ||
|
|
6a212b762a | ||
|
|
c8ec2922cf | ||
|
|
b629b7d333 | ||
|
|
514a8b62d6 | ||
|
|
cd11618a5d | ||
|
|
8be3cb157a | ||
|
|
4ca57cc025 | ||
|
|
397bcc94c5 | ||
|
|
8b28bccfd7 | ||
|
|
c6107057d9 | ||
|
|
ab2a9530e9 | ||
|
|
bfc771bd99 | ||
|
|
e75e588755 | ||
|
|
0266bb49ca | ||
|
|
9e693fd555 |
28
.github/workflows/ci.yml
vendored
28
.github/workflows/ci.yml
vendored
@@ -23,6 +23,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: ChromeExtension
|
name: ChromeExtension
|
||||||
path: dist
|
path: dist
|
||||||
|
- run: mkdir ./builds
|
||||||
|
- uses: montudor/action-zip@v0.1.0
|
||||||
|
with:
|
||||||
|
args: zip -qq -r ./builds/ChromeExtension.zip ./dist
|
||||||
|
|
||||||
# Create Firefox artifacts
|
# Create Firefox artifacts
|
||||||
- name: Create Firefox artifacts
|
- name: Create Firefox artifacts
|
||||||
@@ -31,4 +35,28 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: FirefoxExtension
|
name: FirefoxExtension
|
||||||
path: dist
|
path: dist
|
||||||
|
- uses: montudor/action-zip@v0.1.0
|
||||||
|
with:
|
||||||
|
args: zip -qq -r ./builds/FirefoxExtension.zip ./dist
|
||||||
|
|
||||||
|
# Create Beta artifacts (Builds with the name changed to beta)
|
||||||
|
- name: Create Chrome Beta artifacts
|
||||||
|
run: npm run build:chrome -- --env.stream=beta
|
||||||
|
- uses: actions/upload-artifact@v1
|
||||||
|
with:
|
||||||
|
name: ChromeExtensionBeta
|
||||||
|
path: dist
|
||||||
|
- uses: montudor/action-zip@v0.1.0
|
||||||
|
with:
|
||||||
|
args: zip -qq -r ./builds/ChromeExtensionBeta.zip ./dist
|
||||||
|
|
||||||
|
- name: Create Firefox Beta artifacts
|
||||||
|
run: npm run build:firefox -- --env.stream=beta
|
||||||
|
- uses: actions/upload-artifact@v1
|
||||||
|
with:
|
||||||
|
name: FirefoxExtensionBeta
|
||||||
|
path: dist
|
||||||
|
- uses: montudor/action-zip@v0.1.0
|
||||||
|
with:
|
||||||
|
args: zip -qq -r ./builds/FirefoxExtensionBeta.zip ./dist
|
||||||
|
|
||||||
|
|||||||
29
.github/workflows/release.yml
vendored
Normal file
29
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
name: Upload Release Build
|
||||||
|
|
||||||
|
on: release
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
build:
|
||||||
|
name: Upload Release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# Build Artifacts
|
||||||
|
- name: Build Artifacts
|
||||||
|
uses: ./.github/workflows/ci.yml
|
||||||
|
|
||||||
|
# Upload each release asset
|
||||||
|
- name: Upload to release
|
||||||
|
uses: JasonEtco/upload-to-release@master
|
||||||
|
with:
|
||||||
|
args: ./builds/ChromeExtension.zip
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Upload to release
|
||||||
|
uses: JasonEtco/upload-to-release@master
|
||||||
|
with:
|
||||||
|
args: ./builds/FirefoxExtension.zip
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
@@ -68,9 +68,9 @@ The result is in `dist`.
|
|||||||
|
|
||||||
# Credit
|
# Credit
|
||||||
|
|
||||||
The awesome [Invidious API](https://github.com/omarroth/invidious/wiki/API) used to be used.
|
The awesome [Invidious API](https://github.com/omarroth/invidious/wiki/API) previously was used.
|
||||||
|
|
||||||
Original code from [YTSponsorSkip](https://github.com/OfficialNoob/YTSponsorSkip), but not much of the code is left.
|
Originally forked from [YTSponsorSkip](https://github.com/OfficialNoob/YTSponsorSkip), but zero code remains.
|
||||||
|
|
||||||
Some icons made by <a href="https://www.flaticon.com/authors/gregor-cresnar" title="Gregor Cresnar">Gregor Cresnar</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> and are licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a>
|
Some icons made by <a href="https://www.flaticon.com/authors/gregor-cresnar" title="Gregor Cresnar">Gregor Cresnar</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> and are licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a>
|
||||||
|
|
||||||
|
|||||||
4
manifest/beta-manifest-extra.json
Normal file
4
manifest/beta-manifest-extra.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"name": "BETA - SponsorBlock"
|
||||||
|
}
|
||||||
|
|
||||||
8
manifest/firefox-beta-manifest-extra.json
Normal file
8
manifest/firefox-beta-manifest-extra.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"browser_specific_settings": {
|
||||||
|
"gecko": {
|
||||||
|
"id": "sponsorBlockerBETA@ajay.app"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "__MSG_fullName__",
|
"name": "__MSG_fullName__",
|
||||||
"short_name": "__MSG_Name__",
|
"short_name": "__MSG_Name__",
|
||||||
"version": "1.2.14",
|
"version": "1.2.17",
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"description": "__MSG_Description__",
|
"description": "__MSG_Description__",
|
||||||
"content_scripts": [{
|
"content_scripts": [{
|
||||||
|
|||||||
@@ -24,16 +24,19 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"web-run": "npm run web-run:chrome",
|
"web-run": "npm run web-run:chrome",
|
||||||
"web-run:firefox": "cd dist && web-ext run --start-url https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm",
|
"web-run:firefox": "cd dist && web-ext run --start-url https://addons.mozilla.org/firefox/addon/ublock-origin/",
|
||||||
"web-run:chrome": "cd dist && web-ext run --start-url https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm -t chromium",
|
"web-run:chrome": "cd dist && web-ext run --start-url https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm -t chromium",
|
||||||
"build": "npm run build:chrome",
|
"build": "npm run build:chrome",
|
||||||
"build:chrome": "webpack --env.browser=chrome --config webpack/webpack.prod.js",
|
"build:chrome": "webpack --env.browser=chrome --config webpack/webpack.prod.js",
|
||||||
"build:firefox": "webpack --env.browser=firefox --config webpack/webpack.prod.js",
|
"build:firefox": "webpack --env.browser=firefox --config webpack/webpack.prod.js",
|
||||||
|
"build:dev": "npm run build:dev:chrome",
|
||||||
|
"build:dev:chrome": "webpack --env.browser=chrome --config webpack/webpack.dev.js",
|
||||||
|
"build:dev:firefox": "webpack --env.browser=firefox --config webpack/webpack.dev.js",
|
||||||
"build:watch": "npm run build:watch:chrome",
|
"build:watch": "npm run build:watch:chrome",
|
||||||
"build:watch:chrome": "webpack --env.browser=chrome --config webpack/webpack.dev.js --watch",
|
"build:watch:chrome": "webpack --env.browser=chrome --config webpack/webpack.dev.js --watch",
|
||||||
"build:watch:firefox": "webpack --env.browser=firefox --config webpack/webpack.dev.js --watch",
|
"build:watch:firefox": "webpack --env.browser=firefox --config webpack/webpack.dev.js --watch",
|
||||||
"dev": "npm run build && concurrently \"npm run web-run\" \"npm run build:watch\"",
|
"dev": "npm run build:dev && concurrently \"npm run web-run\" \"npm run build:watch\"",
|
||||||
"dev:firefox": "npm run build:firefox && concurrently \"npm run web-run:firefox\" \"npm run build:watch:firefox\"",
|
"dev:firefox": "npm run build:dev:firefox && concurrently \"npm run web-run:firefox\" \"npm run build:watch:firefox\"",
|
||||||
"clean": "rimraf dist",
|
"clean": "rimraf dist",
|
||||||
"test": "npx jest"
|
"test": "npx jest"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -381,17 +381,11 @@
|
|||||||
"whatAutoUpvote": {
|
"whatAutoUpvote": {
|
||||||
"message": "With this enabled, the extension will upvote all submissions you view if you do not report them. If the notice is disabled, this will not occur."
|
"message": "With this enabled, the extension will upvote all submissions you view if you do not report them. If the notice is disabled, this will not occur."
|
||||||
},
|
},
|
||||||
"invidiousInfo1": {
|
|
||||||
"message": "Invidious (the 3rd party YouTube site) support has been added!"
|
|
||||||
},
|
|
||||||
"invidiousInfo2": {
|
|
||||||
"message": "You MUST enable it in the options for it to work."
|
|
||||||
},
|
|
||||||
"minDuration": {
|
"minDuration": {
|
||||||
"message": "Minimum duration (seconds):"
|
"message": "Minimum duration (seconds):"
|
||||||
},
|
},
|
||||||
"minDurationDescription": {
|
"minDurationDescription": {
|
||||||
"message": "Sponsor segments shorter than the set value will not be skipeed or show in the player."
|
"message": "Sponsor segments shorter than the set value will not be skipped or show in the player."
|
||||||
},
|
},
|
||||||
"shortCheck": {
|
"shortCheck": {
|
||||||
"message": "The following submission is shorter than your minimum duration option. This could mean that this is already submitted, and just being ignored due to this option. Are you sure you would like to submit?"
|
"message": "The following submission is shorter than your minimum duration option. This could mean that this is already submitted, and just being ignored due to this option. Are you sure you would like to submit?"
|
||||||
@@ -428,5 +422,8 @@
|
|||||||
},
|
},
|
||||||
"whatUnlistedCheck": {
|
"whatUnlistedCheck": {
|
||||||
"message": "This setting will significantly slow down SponsorBlock. Sponsor lookups require sending the video ID to the server. If you are concerned about unlisted video IDs being sent over the internet, enable this option."
|
"message": "This setting will significantly slow down SponsorBlock. Sponsor lookups require sending the video ID to the server. If you are concerned about unlisted video IDs being sent over the internet, enable this option."
|
||||||
|
},
|
||||||
|
"mobileUpdateInfo": {
|
||||||
|
"message": "m.youtube.com is now supported"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,9 +86,9 @@ chrome.runtime.onInstalled.addListener(function (object) {
|
|||||||
//save this UUID
|
//save this UUID
|
||||||
Config.config.userID = newUserID;
|
Config.config.userID = newUserID;
|
||||||
|
|
||||||
//TODO: Remove when invidious support is old
|
//TODO: Remove when mobile support is old
|
||||||
// Don't show this to new users
|
// Don't show this to new users
|
||||||
Config.config.invidiousUpdateInfoShowCount = 6;
|
// Config.config.mobileUpdateShowCount = 1;
|
||||||
}
|
}
|
||||||
}, 1500);
|
}, 1500);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -20,12 +20,12 @@ interface SBConfig {
|
|||||||
hideDiscordLaunches: number,
|
hideDiscordLaunches: number,
|
||||||
hideDiscordLink: boolean,
|
hideDiscordLink: boolean,
|
||||||
invidiousInstances: string[],
|
invidiousInstances: string[],
|
||||||
invidiousUpdateInfoShowCount: number,
|
|
||||||
autoUpvote: boolean,
|
autoUpvote: boolean,
|
||||||
supportInvidious: boolean,
|
supportInvidious: boolean,
|
||||||
serverAddress: string,
|
serverAddress: string,
|
||||||
minDuration: number,
|
minDuration: number,
|
||||||
checkForUnlistedVideos: boolean
|
checkForUnlistedVideos: boolean,
|
||||||
|
mobileUpdateShowCount: number
|
||||||
}
|
}
|
||||||
|
|
||||||
interface SBObject {
|
interface SBObject {
|
||||||
@@ -116,12 +116,12 @@ var Config: SBObject = {
|
|||||||
hideDiscordLaunches: 0,
|
hideDiscordLaunches: 0,
|
||||||
hideDiscordLink: false,
|
hideDiscordLink: false,
|
||||||
invidiousInstances: ["invidio.us", "invidiou.sh", "invidious.snopyta.org"],
|
invidiousInstances: ["invidio.us", "invidiou.sh", "invidious.snopyta.org"],
|
||||||
invidiousUpdateInfoShowCount: 0,
|
|
||||||
autoUpvote: true,
|
autoUpvote: true,
|
||||||
supportInvidious: false,
|
supportInvidious: false,
|
||||||
serverAddress: CompileConfig.serverAddress,
|
serverAddress: CompileConfig.serverAddress,
|
||||||
minDuration: 0,
|
minDuration: 0,
|
||||||
checkForUnlistedVideos: false
|
checkForUnlistedVideos: false,
|
||||||
|
mobileUpdateShowCount: 0
|
||||||
},
|
},
|
||||||
localConfig: null,
|
localConfig: null,
|
||||||
config: null
|
config: null
|
||||||
|
|||||||
@@ -43,8 +43,9 @@ var lastPreviewBarUpdate;
|
|||||||
|
|
||||||
//whether the duration listener listening for the duration changes of the video has been setup yet
|
//whether the duration listener listening for the duration changes of the video has been setup yet
|
||||||
var durationListenerSetUp = false;
|
var durationListenerSetUp = false;
|
||||||
// Timestamp of the last duration change
|
|
||||||
var lastDurationChange = 0;
|
// Has a zero second sponsor been skipped yet
|
||||||
|
var skippedZeroSecond = false;
|
||||||
|
|
||||||
//the channel this video is about
|
//the channel this video is about
|
||||||
var channelURL;
|
var channelURL;
|
||||||
@@ -66,10 +67,7 @@ var previewResetter: NodeJS.Timeout = null;
|
|||||||
var controls = null;
|
var controls = null;
|
||||||
|
|
||||||
// Direct Links after the config is loaded
|
// Direct Links after the config is loaded
|
||||||
utils.wait(() => Config.config !== null).then(() => videoIDChange(getYouTubeVideoID(document.URL)));
|
utils.wait(() => Config.config !== null, 1000, 1).then(() => videoIDChange(getYouTubeVideoID(document.URL)));
|
||||||
|
|
||||||
//the last time looked at (used to see if this time is in the interval)
|
|
||||||
var lastTime = -1;
|
|
||||||
|
|
||||||
//the amount of times the sponsor lookup has retried
|
//the amount of times the sponsor lookup has retried
|
||||||
//this only happens if there is an error
|
//this only happens if there is an error
|
||||||
@@ -240,9 +238,6 @@ document.onkeydown = function(e: KeyboardEvent){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function resetValues() {
|
function resetValues() {
|
||||||
//reset last sponsor times
|
|
||||||
lastTime = -1;
|
|
||||||
|
|
||||||
//reset sponsor times
|
//reset sponsor times
|
||||||
sponsorTimes = null;
|
sponsorTimes = null;
|
||||||
UUIDs = [];
|
UUIDs = [];
|
||||||
@@ -255,6 +250,8 @@ function resetValues() {
|
|||||||
|
|
||||||
//reset sponsor data found check
|
//reset sponsor data found check
|
||||||
sponsorDataFound = false;
|
sponsorDataFound = false;
|
||||||
|
|
||||||
|
skippedZeroSecond = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function videoIDChange(id) {
|
async function videoIDChange(id) {
|
||||||
@@ -430,14 +427,14 @@ function createPreviewBar(): void {
|
|||||||
* This happens when the resolution changes or at random time to clear memory.
|
* This happens when the resolution changes or at random time to clear memory.
|
||||||
*/
|
*/
|
||||||
function durationChangeListener() {
|
function durationChangeListener() {
|
||||||
lastDurationChange = Date.now();
|
|
||||||
|
|
||||||
updatePreviewBar();
|
updatePreviewBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
function cancelSponsorSchedule(): void {
|
function cancelSponsorSchedule(): void {
|
||||||
if (currentSkipSchedule !== null) {
|
if (currentSkipSchedule !== null) {
|
||||||
clearTimeout(currentSkipSchedule);
|
clearTimeout(currentSkipSchedule);
|
||||||
|
|
||||||
|
currentSkipSchedule = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -448,7 +445,7 @@ function cancelSponsorSchedule(): void {
|
|||||||
function startSponsorSchedule(currentTime?: number): void {
|
function startSponsorSchedule(currentTime?: number): void {
|
||||||
cancelSponsorSchedule();
|
cancelSponsorSchedule();
|
||||||
|
|
||||||
if (sponsorTimes === null || Config.config.disableSkipping || channelWhitelisted){
|
if (Config.config.disableSkipping || channelWhitelisted){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -456,18 +453,26 @@ function startSponsorSchedule(currentTime?: number): void {
|
|||||||
|
|
||||||
let skipInfo = getNextSkipIndex(currentTime);
|
let skipInfo = getNextSkipIndex(currentTime);
|
||||||
|
|
||||||
|
if (skipInfo.index === -1) return;
|
||||||
|
|
||||||
let skipTime = skipInfo.array[skipInfo.index];
|
let skipTime = skipInfo.array[skipInfo.index];
|
||||||
let timeUntilSponsor = skipTime[0] - currentTime;
|
let timeUntilSponsor = skipTime[0] - currentTime;
|
||||||
|
|
||||||
currentSkipSchedule = setTimeout(() => {
|
let skippingFunction = () => {
|
||||||
if (video.currentTime >= skipTime[0] && video.currentTime < skipTime[1]) {
|
if (video.currentTime >= skipTime[0] && video.currentTime < skipTime[1]) {
|
||||||
|
if (currentTime == 0) skippedZeroSecond = true;
|
||||||
|
|
||||||
skipToTime(video, skipInfo.index, skipInfo.array, skipInfo.openNotice);
|
skipToTime(video, skipInfo.index, skipInfo.array, skipInfo.openNotice);
|
||||||
|
}
|
||||||
|
|
||||||
startSponsorSchedule();
|
startSponsorSchedule();
|
||||||
|
};
|
||||||
|
|
||||||
|
if (timeUntilSponsor <= 0) {
|
||||||
|
skippingFunction();
|
||||||
} else {
|
} else {
|
||||||
startSponsorSchedule();
|
currentSkipSchedule = setTimeout(skippingFunction, timeUntilSponsor * 1000 * (1 / video.playbackRate));
|
||||||
}
|
}
|
||||||
}, timeUntilSponsor * 1000 * (1 / video.playbackRate));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function sponsorsLookup(id: string, channelIDPromise?) {
|
function sponsorsLookup(id: string, channelIDPromise?) {
|
||||||
@@ -493,6 +498,8 @@ function sponsorsLookup(id: string, channelIDPromise?) {
|
|||||||
video.addEventListener('ratechange', () => startSponsorSchedule());
|
video.addEventListener('ratechange', () => startSponsorSchedule());
|
||||||
video.addEventListener('seeking', cancelSponsorSchedule);
|
video.addEventListener('seeking', cancelSponsorSchedule);
|
||||||
video.addEventListener('pause', cancelSponsorSchedule);
|
video.addEventListener('pause', cancelSponsorSchedule);
|
||||||
|
|
||||||
|
startSponsorSchedule();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (channelIDPromise !== undefined) {
|
if (channelIDPromise !== undefined) {
|
||||||
@@ -562,7 +569,7 @@ function sponsorsLookup(id: string, channelIDPromise?) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zeroSecondSponsor) {
|
if (zeroSecondSponsor && !skippedZeroSecond) {
|
||||||
startSponsorSchedule(0);
|
startSponsorSchedule(0);
|
||||||
} else {
|
} else {
|
||||||
startSponsorSchedule();
|
startSponsorSchedule();
|
||||||
@@ -767,7 +774,8 @@ function getNextSkipIndex(currentTime: number): {array: number[][], index: numbe
|
|||||||
|
|
||||||
let minPreviewSponsorTimeIndex = previewSponsorStartTimes.indexOf(Math.min(...previewSponsorStartTimesAfterCurrentTime));
|
let minPreviewSponsorTimeIndex = previewSponsorStartTimes.indexOf(Math.min(...previewSponsorStartTimesAfterCurrentTime));
|
||||||
|
|
||||||
if (minPreviewSponsorTimeIndex == -1 || sponsorStartTimes[minSponsorTimeIndex] < previewSponsorStartTimes[minPreviewSponsorTimeIndex]) {
|
if ((minPreviewSponsorTimeIndex === -1 && minSponsorTimeIndex !== -1) ||
|
||||||
|
sponsorStartTimes[minSponsorTimeIndex] < previewSponsorStartTimes[minPreviewSponsorTimeIndex]) {
|
||||||
return {
|
return {
|
||||||
array: sponsorTimes,
|
array: sponsorTimes,
|
||||||
index: minSponsorTimeIndex,
|
index: minSponsorTimeIndex,
|
||||||
@@ -791,6 +799,8 @@ function getNextSkipIndex(currentTime: number): {array: number[][], index: numbe
|
|||||||
* @param hideHiddenSponsors
|
* @param hideHiddenSponsors
|
||||||
*/
|
*/
|
||||||
function getStartTimes(sponsorTimes: number[][], minimum?: number, hideHiddenSponsors: boolean = false): number[] {
|
function getStartTimes(sponsorTimes: number[][], minimum?: number, hideHiddenSponsors: boolean = false): number[] {
|
||||||
|
if (sponsorTimes === null) return [];
|
||||||
|
|
||||||
let startTimes: number[] = [];
|
let startTimes: number[] = [];
|
||||||
|
|
||||||
for (let i = 0; i < sponsorTimes.length; i++) {
|
for (let i = 0; i < sponsorTimes.length; i++) {
|
||||||
@@ -802,7 +812,7 @@ function getStartTimes(sponsorTimes: number[][], minimum?: number, hideHiddenSpo
|
|||||||
return startTimes;
|
return startTimes;
|
||||||
}
|
}
|
||||||
|
|
||||||
//skip from fhe start time to the end time for a certain index sponsor time
|
//skip from the start time to the end time for a certain index sponsor time
|
||||||
function skipToTime(v, index, sponsorTimes, openNotice) {
|
function skipToTime(v, index, sponsorTimes, openNotice) {
|
||||||
if (!Config.config.disableAutoSkip || previewResetter !== null) {
|
if (!Config.config.disableAutoSkip || previewResetter !== null) {
|
||||||
v.currentTime = sponsorTimes[index][1];
|
v.currentTime = sponsorTimes[index][1];
|
||||||
@@ -816,8 +826,16 @@ function skipToTime(v, index, sponsorTimes, openNotice) {
|
|||||||
if (openNotice) {
|
if (openNotice) {
|
||||||
//send out the message saying that a sponsor message was skipped
|
//send out the message saying that a sponsor message was skipped
|
||||||
if (!Config.config.dontShowNotice) {
|
if (!Config.config.dontShowNotice) {
|
||||||
|
|
||||||
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);
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class SkipNotice {
|
|||||||
noticeElement.style.zIndex = String(50 + amountOfPreviousNotices);
|
noticeElement.style.zIndex = String(50 + amountOfPreviousNotices);
|
||||||
if (contentContainer().onMobileYouTube) {
|
if (contentContainer().onMobileYouTube) {
|
||||||
noticeElement.style.bottom = "4em";
|
noticeElement.style.bottom = "4em";
|
||||||
noticeElement.style.zoom = "0.8";
|
noticeElement.style.transform = "scale(0.8) translate(10%, 10%)";
|
||||||
}
|
}
|
||||||
|
|
||||||
//add mouse enter and leave listeners
|
//add mouse enter and leave listeners
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ async function runThePopup(messageListener?: MessageListener) {
|
|||||||
|
|
||||||
//get the amount of times this user has contributed and display it to thank them
|
//get the amount of times this user has contributed and display it to thank them
|
||||||
if (Config.config.sponsorTimesContributed != undefined) {
|
if (Config.config.sponsorTimesContributed != undefined) {
|
||||||
if (Config.config.sponsorTimesContributed > 1) {
|
if (Config.config.sponsorTimesContributed !== 1) {
|
||||||
PageElements.sponsorTimesContributionsDisplayEndWord.innerText = chrome.i18n.getMessage("Sponsors");
|
PageElements.sponsorTimesContributionsDisplayEndWord.innerText = chrome.i18n.getMessage("Sponsors");
|
||||||
} else {
|
} else {
|
||||||
PageElements.sponsorTimesContributionsDisplayEndWord.innerText = chrome.i18n.getMessage("Sponsor");
|
PageElements.sponsorTimesContributionsDisplayEndWord.innerText = chrome.i18n.getMessage("Sponsor");
|
||||||
|
|||||||
@@ -42,7 +42,8 @@ module.exports = env => ({
|
|||||||
),
|
),
|
||||||
new BuildManifest({
|
new BuildManifest({
|
||||||
browser: env.browser,
|
browser: env.browser,
|
||||||
pretty: env.mode === "production"
|
pretty: env.mode === "production",
|
||||||
|
stream: env.stream
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ const fs = require('fs');
|
|||||||
const manifest = require("../manifest/manifest.json");
|
const manifest = require("../manifest/manifest.json");
|
||||||
const firefoxManifestExtra = require("../manifest/firefox-manifest-extra.json");
|
const firefoxManifestExtra = require("../manifest/firefox-manifest-extra.json");
|
||||||
const chromeManifestExtra = require("../manifest/chrome-manifest-extra.json");
|
const chromeManifestExtra = require("../manifest/chrome-manifest-extra.json");
|
||||||
|
const betaManifestExtra = require("../manifest/beta-manifest-extra.json");
|
||||||
|
const firefoxBetaManifestExtra = require("../manifest/firefox-beta-manifest-extra.json");
|
||||||
|
|
||||||
// schema for options object
|
// schema for options object
|
||||||
const schema = {
|
const schema = {
|
||||||
@@ -18,6 +20,9 @@ const schema = {
|
|||||||
},
|
},
|
||||||
pretty: {
|
pretty: {
|
||||||
type: 'boolean'
|
type: 'boolean'
|
||||||
|
},
|
||||||
|
steam: {
|
||||||
|
type: 'string'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -40,6 +45,14 @@ class BuildManifest {
|
|||||||
mergeObjects(manifest, chromeManifestExtra);
|
mergeObjects(manifest, chromeManifestExtra);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.options.stream === "beta") {
|
||||||
|
mergeObjects(manifest, betaManifestExtra);
|
||||||
|
|
||||||
|
if (this.options.browser.toLowerCase() === "firefox") {
|
||||||
|
mergeObjects(manifest, firefoxBetaManifestExtra);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let result = JSON.stringify(manifest);
|
let result = JSON.stringify(manifest);
|
||||||
if (this.options.pretty) result = JSON.stringify(manifest, null, 2);
|
if (this.options.pretty) result = JSON.stringify(manifest, null, 2);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user