mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-06 19:47:04 +03:00
Backwards compatibility
This commit is contained in:
10
SB.js
10
SB.js
@@ -26,9 +26,19 @@ fetchConfig = () => new Promise((resolve, reject) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function migrate() { // Convert sponsorTimes format
|
||||||
|
for (key in SB.localconfig) {
|
||||||
|
if (key.startsWith("sponsortime")) {
|
||||||
|
SB.config.sponsorTimes.set(key.substr(12), SB.config[key]);
|
||||||
|
delete SB.config[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function config() {
|
async function config() {
|
||||||
await fetchConfig();
|
await fetchConfig();
|
||||||
addDefaults();
|
addDefaults();
|
||||||
|
migrate();
|
||||||
SB.config = configProxy();
|
SB.config = configProxy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user