From 795f21baba2e1904eca3576486675741e4a5e2d6 Mon Sep 17 00:00:00 2001 From: "Ilya Ig. Petrov" Date: Sat, 11 Nov 2017 17:18:20 +0500 Subject: [PATCH 1/3] Bump 0.0.1.7 --- .../chromium/runet-censorship-bypass/src/templates-data.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/chromium/runet-censorship-bypass/src/templates-data.js b/extensions/chromium/runet-censorship-bypass/src/templates-data.js index 230be9f..bfbfe9b 100644 --- a/extensions/chromium/runet-censorship-bypass/src/templates-data.js +++ b/extensions/chromium/runet-censorship-bypass/src/templates-data.js @@ -12,7 +12,7 @@ const pacUrls = [ ]; const commonContext = { - version: '1.6', + version: '1.7', anticensorityPacUrls: [ ...pacUrls, ], From 46f311678ca6a1b6ef5222f8b267412c9e8304e5 Mon Sep 17 00:00:00 2001 From: "Ilya Ig. Petrov" Date: Sun, 12 Nov 2017 08:30:16 +0500 Subject: [PATCH 2/3] Wrap update in try/catch, finally force update --- ...c-pac-script-with-pac-provider-api.tmpl.js | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 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 78d2127..9c07766 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 @@ -533,16 +533,22 @@ }); console.log('Updating from', oldStorage.version, 'to', antiCensorRu.version); - if (window.apis.version.isLeq(oldStorage.version, '0.0.1.5')) { + try { + if (window.apis.version.isLeq(oldStorage.version, '0.0.1.5')) { - // Change semicolons to semicolons followed by newlines in proxy string (raw). - const migrateProxies = (oldStr) => oldStr.replace(/;\\r?\\n?/g, ';\\n'); - const modsMutated = window.apis.pacKitchen.getPacModsRaw(); - modsMutated['customProxyStringRaw'] = migrateProxies(modsMutated['customProxyStringRaw']); - await new Promise( - (resolve) => window.apis.pacKitchen.keepCookedNowAsync(modsMutated, resolve), - ); + // Change semicolons to semicolons followed by newlines in proxy string (raw). + const migrateProxies = (oldStr) => oldStr.replace(/;\\r?\\n?/g, ';\\n'); + const modsMutated = window.apis.pacKitchen.getPacModsRaw(); + if (modsMutated) { + modsMutated['customProxyStringRaw'] = migrateProxies(modsMutated['customProxyStringRaw']); + await new Promise( + (resolve) => window.apis.pacKitchen.keepCookedNowAsync(modsMutated, resolve), + ); + } + } + } catch (e) { + // Swallow update error. } ifUpdatedCb(); From 13de0bf079a043b799aa2b5aac4526189cd3ab36 Mon Sep 17 00:00:00 2001 From: "Ilya Ig. Petrov" Date: Sun, 12 Nov 2017 08:31:01 +0500 Subject: [PATCH 3/3] Bump 0.0.1.10 --- .../chromium/runet-censorship-bypass/src/templates-data.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/chromium/runet-censorship-bypass/src/templates-data.js b/extensions/chromium/runet-censorship-bypass/src/templates-data.js index bfbfe9b..3fe3be8 100644 --- a/extensions/chromium/runet-censorship-bypass/src/templates-data.js +++ b/extensions/chromium/runet-censorship-bypass/src/templates-data.js @@ -12,7 +12,7 @@ const pacUrls = [ ]; const commonContext = { - version: '1.7', + version: '1.10', anticensorityPacUrls: [ ...pacUrls, ],