Merge pull request #290 from ajayyy/experimental

Potentially fixed zero second skip spam
This commit is contained in:
Ajay Ramachandran 2020-02-27 22:21:33 -05:00 committed by GitHub
commit 2e49bb73c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 6 deletions

View file

@ -1,4 +1,4 @@
{
"name": "__MSG_betaName__"
"name": "BETA - SponsorBlock"
}

View file

@ -0,0 +1,8 @@
{
"browser_specific_settings": {
"gecko": {
"id": "sponsorBlockerBETA@ajay.app"
}
}
}

View file

@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "__MSG_Name__",
"version": "1.2.16",
"version": "1.2.17",
"default_locale": "en",
"description": "__MSG_Description__",
"content_scripts": [{

View file

@ -423,9 +423,6 @@
"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."
},
"betaName": {
"message": "BETA - SponsorBlock"
},
"mobileUpdateInfo": {
"message": "m.youtube.com is now supported"
}

View file

@ -44,6 +44,9 @@ var lastPreviewBarUpdate;
//whether the duration listener listening for the duration changes of the video has been setup yet
var durationListenerSetUp = false;
// Has a zero second sponsor been skipped yet
var skippedZeroSecond = false;
//the channel this video is about
var channelURL;
@ -247,6 +250,8 @@ function resetValues() {
//reset sponsor data found check
sponsorDataFound = false;
skippedZeroSecond = false;
}
async function videoIDChange(id) {
@ -455,6 +460,8 @@ function startSponsorSchedule(currentTime?: number): void {
let skippingFunction = () => {
if (video.currentTime >= skipTime[0] && video.currentTime < skipTime[1]) {
if (currentTime == 0) skippedZeroSecond = true;
skipToTime(video, skipInfo.index, skipInfo.array, skipInfo.openNotice);
}
@ -562,7 +569,7 @@ function sponsorsLookup(id: string, channelIDPromise?) {
}
}
if (zeroSecondSponsor) {
if (zeroSecondSponsor && !skippedZeroSecond) {
startSponsorSchedule(0);
} else {
startSponsorSchedule();

View file

@ -9,6 +9,7 @@ const manifest = require("../manifest/manifest.json");
const firefoxManifestExtra = require("../manifest/firefox-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
const schema = {
@ -46,6 +47,10 @@ class BuildManifest {
if (this.options.stream === "beta") {
mergeObjects(manifest, betaManifestExtra);
if (this.options.browser.toLowerCase() === "firefox") {
mergeObjects(manifest, firefoxBetaManifestExtra);
}
}
let result = JSON.stringify(manifest);