mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-09 13:07:05 +03:00
migrate and populat on reset
This commit is contained in:
@@ -189,7 +189,7 @@ const Config: SBObject = {
|
|||||||
hideSkipButtonPlayerControls: false,
|
hideSkipButtonPlayerControls: false,
|
||||||
hideDiscordLaunches: 0,
|
hideDiscordLaunches: 0,
|
||||||
hideDiscordLink: false,
|
hideDiscordLink: false,
|
||||||
invidiousInstances: invidiousList,
|
invidiousInstances: ["invidious.snopyta.org"], // leave as default
|
||||||
supportInvidious: false,
|
supportInvidious: false,
|
||||||
serverAddress: CompileConfig.serverAddress,
|
serverAddress: CompileConfig.serverAddress,
|
||||||
minDuration: 0,
|
minDuration: 0,
|
||||||
@@ -433,6 +433,11 @@ function migrateOldFormats(config: SBConfig) {
|
|||||||
if (config["previousVideoID"] !== undefined) {
|
if (config["previousVideoID"] !== undefined) {
|
||||||
chrome.storage.sync.remove("previousVideoID");
|
chrome.storage.sync.remove("previousVideoID");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// populate invidiousInstances with new instances if 3p support is **DISABLED**
|
||||||
|
if (!config["supportInvidious"]) {
|
||||||
|
config["invidiousInstances"] = invidiousList
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function setupConfig() {
|
async function setupConfig() {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import Config from "./config";
|
import Config from "./config";
|
||||||
import * as CompileConfig from "../config.json";
|
import * as CompileConfig from "../config.json";
|
||||||
|
import * as invidiousList from "../ci/invidiouslist.json";
|
||||||
|
|
||||||
// Make the config public for debugging purposes
|
// Make the config public for debugging purposes
|
||||||
window.SB = Config;
|
window.SB = Config;
|
||||||
@@ -297,8 +298,8 @@ function invidiousInstanceAddInit(element: HTMLElement, option: string) {
|
|||||||
const resetButton = element.querySelector(".invidious-instance-reset");
|
const resetButton = element.querySelector(".invidious-instance-reset");
|
||||||
resetButton.addEventListener("click", function() {
|
resetButton.addEventListener("click", function() {
|
||||||
if (confirm(chrome.i18n.getMessage("resetInvidiousInstanceAlert"))) {
|
if (confirm(chrome.i18n.getMessage("resetInvidiousInstanceAlert"))) {
|
||||||
// Set to a clone of the default
|
// Set to CI populated list
|
||||||
Config.config[option] = Config.defaults[option].slice(0);
|
Config.config[option] = invidiousList;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user