mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-27 20:03:45 +03:00
Define migration replacement
This commit is contained in:
parent
15e95d6e07
commit
c9c7b15d9b
|
@ -527,10 +527,10 @@
|
||||||
console.log('Updating from', oldStorage.version, 'to', antiCensorRu.version);
|
console.log('Updating from', oldStorage.version, 'to', antiCensorRu.version);
|
||||||
if (window.apis.version.isLeq(oldStorage.version, '0.0.1.5')) {
|
if (window.apis.version.isLeq(oldStorage.version, '0.0.1.5')) {
|
||||||
|
|
||||||
// Change semicolons to newlines in proxy string (raw).
|
// Change semicolons to semicolons followed by newlines in proxy string (raw).
|
||||||
// TODO:
|
const migrateProxies = (oldStr) => oldStr.replace(/;\r?\n?/g, ';\n');
|
||||||
const modsMutated = window.apis.pacKitchen.getPacMods();
|
const modsMutated = window.apis.pacKitchen.getPacMods();
|
||||||
modsMutated['customProxyStringRaw'] = MIGRATE(conf.value);
|
modsMutated['customProxyStringRaw'] = migrateProxies(conf.value);
|
||||||
window.apis.pacKitchen.keepCookedNowAsync(modsMutated, cb);
|
window.apis.pacKitchen.keepCookedNowAsync(modsMutated, cb);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,10 +161,10 @@ export default function getProxyEditor(theState) {
|
||||||
const splitBySemi = (proxyString) => proxyString
|
const splitBySemi = (proxyString) => proxyString
|
||||||
.replace(/#.*$/mg, '')
|
.replace(/#.*$/mg, '')
|
||||||
.trim()
|
.trim()
|
||||||
.split(/\s*;\s*/g)
|
.split(/\s*;\r?\n\s*/g)
|
||||||
.filter((s) => s);
|
.filter((s) => s);
|
||||||
|
|
||||||
const joinBySemi = (strs) => strs.join(';\n') + ';';
|
const joinBySemi = (strs) => strs.join(';\n') + ';\n';
|
||||||
const normalizeProxyString = (str) => joinBySemi(splitBySemi(str));
|
const normalizeProxyString = (str) => joinBySemi(splitBySemi(str));
|
||||||
|
|
||||||
const PROXY_TYPE_LABEL_PAIRS = [['PROXY', 'PROXY/HTTP'],['HTTPS'],['SOCKS4'],['SOCKS5'],['SOCKS']];
|
const PROXY_TYPE_LABEL_PAIRS = [['PROXY', 'PROXY/HTTP'],['HTTPS'],['SOCKS4'],['SOCKS5'],['SOCKS']];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user