mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-15 07:57:09 +03:00
Added testing server option.
This commit is contained in:
@@ -27,6 +27,7 @@ interface SBConfig {
|
||||
audioNotificationOnSkip,
|
||||
checkForUnlistedVideos: boolean,
|
||||
mobileUpdateShowCount: number,
|
||||
testingServer: boolean,
|
||||
|
||||
// What categories should be skipped
|
||||
categorySelections: CategorySelection[]
|
||||
@@ -125,6 +126,8 @@ var Config: SBObject = {
|
||||
audioNotificationOnSkip: false,
|
||||
checkForUnlistedVideos: false,
|
||||
mobileUpdateShowCount: 0,
|
||||
testingServer: false,
|
||||
|
||||
categorySelections: [{
|
||||
name: "sponsor",
|
||||
option: CategorySkipOption.AutoSkip
|
||||
|
||||
@@ -32,6 +32,8 @@ async function init() {
|
||||
let checkbox = optionsElements[i].querySelector("input");
|
||||
let reverse = optionsElements[i].getAttribute("toggle-type") === "reverse";
|
||||
|
||||
let confirmMessage = optionsElements[i].getAttribute("confirm-message");
|
||||
|
||||
if (optionResult != undefined) {
|
||||
checkbox.checked = optionResult;
|
||||
|
||||
@@ -49,6 +51,12 @@ async function init() {
|
||||
|
||||
// Add click listener
|
||||
checkbox.addEventListener("click", () => {
|
||||
// Confirm if required
|
||||
if (checkbox.checked && confirmMessage && !confirm(chrome.i18n.getMessage(confirmMessage))){
|
||||
checkbox.checked = false;
|
||||
return;
|
||||
}
|
||||
|
||||
Config.config[option] = reverse ? !checkbox.checked : checkbox.checked;
|
||||
|
||||
// See if anything extra must be run
|
||||
|
||||
Reference in New Issue
Block a user