mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-07 03:57:09 +03:00
Map test
This commit is contained in:
15
popup.js
15
popup.js
@@ -229,8 +229,7 @@ async function runThePopup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//load video times for this video
|
//load video times for this video
|
||||||
let sponsorTimeKey = "sponsorTimes" + currentVideoID;
|
let sponsorTimesStorage = SB.config.sponsorTimes.get(currentVideoID);
|
||||||
let sponsorTimesStorage = SB.config.sponsorTimeKey[sponsorTimeKey];
|
|
||||||
if (sponsorTimesStorage != undefined && sponsorTimesStorage.length > 0) {
|
if (sponsorTimesStorage != undefined && sponsorTimesStorage.length > 0) {
|
||||||
if (sponsorTimesStorage[sponsorTimesStorage.length - 1] != undefined && sponsorTimesStorage[sponsorTimesStorage.length - 1].length < 2) {
|
if (sponsorTimesStorage[sponsorTimesStorage.length - 1] != undefined && sponsorTimesStorage[sponsorTimesStorage.length - 1].length < 2) {
|
||||||
startTimeChosen = true;
|
startTimeChosen = true;
|
||||||
@@ -325,9 +324,8 @@ async function runThePopup() {
|
|||||||
|
|
||||||
sponsorTimes[sponsorTimesIndex][startTimeChosen ? 1 : 0] = response.time;
|
sponsorTimes[sponsorTimesIndex][startTimeChosen ? 1 : 0] = response.time;
|
||||||
|
|
||||||
let sponsorTimeKey = "sponsorTimes" + currentVideoID;
|
|
||||||
let localStartTimeChosen = startTimeChosen;
|
let localStartTimeChosen = startTimeChosen;
|
||||||
SB.config.sponsorTimeKey[sponsorTimeKey] = sponsorTimes;
|
SB.config.sponsorTimes.set(currentVideoID, sponsorTimes);
|
||||||
//send a message to the client script
|
//send a message to the client script
|
||||||
if (localStartTimeChosen) {
|
if (localStartTimeChosen) {
|
||||||
chrome.tabs.query({
|
chrome.tabs.query({
|
||||||
@@ -659,8 +657,7 @@ async function runThePopup() {
|
|||||||
sponsorTimes[index][1] = getSponsorTimeEditTimes("endTime", index);
|
sponsorTimes[index][1] = getSponsorTimeEditTimes("endTime", index);
|
||||||
|
|
||||||
//save this
|
//save this
|
||||||
let sponsorTimeKey = "sponsorTimes" + currentVideoID;
|
SB.config.sponsorTimes.set(currentVideoID, sponsorTimes);
|
||||||
SB.config.sponsorTimeKey[sponsorTimeKey] = sponsorTimes;
|
|
||||||
chrome.tabs.query({
|
chrome.tabs.query({
|
||||||
active: true,
|
active: true,
|
||||||
currentWindow: true
|
currentWindow: true
|
||||||
@@ -699,8 +696,7 @@ async function runThePopup() {
|
|||||||
sponsorTimes.splice(index, 1);
|
sponsorTimes.splice(index, 1);
|
||||||
|
|
||||||
//save this
|
//save this
|
||||||
let sponsorTimeKey = "sponsorTimes" + currentVideoID;
|
SB.config.sponsorTimes.set(currentVideoID, sponsorTimes);
|
||||||
SB.config.sponsorTimeKey[sponsorTimeKey] = sponsorTimes;
|
|
||||||
chrome.tabs.query({
|
chrome.tabs.query({
|
||||||
active: true,
|
active: true,
|
||||||
currentWindow: true
|
currentWindow: true
|
||||||
@@ -751,8 +747,7 @@ async function runThePopup() {
|
|||||||
//reset sponsorTimes
|
//reset sponsorTimes
|
||||||
sponsorTimes = [];
|
sponsorTimes = [];
|
||||||
|
|
||||||
let sponsorTimeKey = "sponsorTimes" + currentVideoID;
|
SB.config.sponsorTimes.set(currentVideoID, sponsorTimes);
|
||||||
SB.config.sponsorTimeKey[sponsorTimeKey] = sponsorTimes;
|
|
||||||
chrome.tabs.query({
|
chrome.tabs.query({
|
||||||
active: true,
|
active: true,
|
||||||
currentWindow: true
|
currentWindow: true
|
||||||
|
|||||||
Reference in New Issue
Block a user