From b3096c8d8327aa64c3a63e88a407b2056a798b78 Mon Sep 17 00:00:00 2001 From: ilyaigpetrov Date: Fri, 5 May 2023 18:39:21 +0500 Subject: [PATCH] Fix buggy update logic --- ...-sync-pac-script-with-pac-provider-api.tmpl.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.js index dc7beab..8eb0915 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.tmpl.js @@ -679,13 +679,14 @@ console.log('Updating from', oldAntiCensorRu.version, 'to', antiCensorRu.version); try { - if (window.apis.version.isLeq(oldAntiCensorRu.version, '0.0.1.57')) { - const azWithPort = 'https://antizapret.prostovpn.org:8443/proxy.pac'; - const azWithPortAlt = 'https://antizapret.prostovpn.org:18443/proxy.pac'; - const urls = window.apis.antiCensorRu.pacProviders['Антизапрет'].pacUrls; - urls[0] = 'https://antizapret.prostovpn.org/proxy.pac'; - urls.unshift(azWithPort, azWithPortAlt); - console.log('Successfully updated to 0.0.1.58.'); + if (window.apis.version.isLeq(oldAntiCensorRu.version, '0.0.1.59')) { + window.apis.antiCensorRu.pacProviders['Антизапрет'].pacUrls = [ + 'https://antizapret.prostovpn.org:8443/proxy.pac', + 'https://antizapret.prostovpn.org:18443/proxy.pac', + 'https://antizapret.prostovpn.org/proxy.pac', + 'https://rebrand.ly/ac-antizapret-pac', + ]; + console.log('Successfully updated to 0.0.1.60.'); } } catch (e) { // Log update error.