From 64ff5e5b8cd8065b777fe6c2451596d73d834b27 Mon Sep 17 00:00:00 2001 From: z0ccc Date: Tue, 31 May 2022 10:29:05 -0400 Subject: [PATCH] v3.4.3 --- modules/ext/package.json | 2 +- modules/ext/public/manifest/base.json | 2 +- modules/ext/src/plugins/proxy/pac.js | 1 + modules/ext/src/plugins/proxy/shouldNotProxy.js | 1 + modules/ext/src/utils/constants.js | 4 ++-- modules/ext/src/utils/public-ip.js | 13 +++++++++---- .../ext/src/views/PreferencesBlocker/index.js | 2 +- modules/ws-api-client/src/api/sendRequest.ts | 16 ++++++++++++++-- 8 files changed, 30 insertions(+), 11 deletions(-) diff --git a/modules/ext/package.json b/modules/ext/package.json index a557f2d..65b6827 100644 --- a/modules/ext/package.json +++ b/modules/ext/package.json @@ -1,6 +1,6 @@ { "name": "ext", - "version": "3.4.2", + "version": "3.4.3", "private": true, "dependencies": { "@babel/plugin-proposal-export-default-from": "~7.8.3", diff --git a/modules/ext/public/manifest/base.json b/modules/ext/public/manifest/base.json index 3ff2b8f..09a173e 100644 --- a/modules/ext/public/manifest/base.json +++ b/modules/ext/public/manifest/base.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "Windscribe - Free Proxy and Ad Blocker", "short_name": "Windscribe", - "version": "3.4.2", + "version": "3.4.3", "description": "Windscribe helps you mask your physical location, circumvent censorship, and block ads and trackers on websites you use every day", "content_security_policy": "script-src 'self'; object-src 'self';", "default_locale": "en", diff --git a/modules/ext/src/plugins/proxy/pac.js b/modules/ext/src/plugins/proxy/pac.js index 00864b7..d9fafa0 100644 --- a/modules/ext/src/plugins/proxy/pac.js +++ b/modules/ext/src/plugins/proxy/pac.js @@ -30,6 +30,7 @@ const createFindProxyForURLFunction = ({ '*://api.windscribe.com/*', '*://assets.windscribe.com/*', '*://*.staticnetcontent.com/*', + '*://*.totallyacdn.com/*', 'https://windscribe.com/installed/*', ].concat(userWhitelist) diff --git a/modules/ext/src/plugins/proxy/shouldNotProxy.js b/modules/ext/src/plugins/proxy/shouldNotProxy.js index 107763b..b84a43a 100644 --- a/modules/ext/src/plugins/proxy/shouldNotProxy.js +++ b/modules/ext/src/plugins/proxy/shouldNotProxy.js @@ -67,6 +67,7 @@ export default function shouldNotProxy(url, host, userWhitelist) { '*://api.windscribe.com/*', '*://assets.windscribe.com/*', '*://*.staticnetcontent.com/*', + '*://*.totallyacdn.com/*', 'https://windscribe.com/installed/*', ].concat(userWhitelist) diff --git a/modules/ext/src/utils/constants.js b/modules/ext/src/utils/constants.js index 13d28b1..2809eb6 100644 --- a/modules/ext/src/utils/constants.js +++ b/modules/ext/src/utils/constants.js @@ -28,8 +28,8 @@ export const ENVS = { PROD: { API_URL: 'https://api.windscribe.com', ASSETS_URL: 'https://assets.windscribe.com', - BACKUP_API_URL: 'https://api.staticnetcontent.com', - BACKUP_ASSETS_URL: 'https://assets.staticnetcontent.com', + BACKUP_API_URL: 'https://api.totallyacdn.com', + BACKUP_ASSETS_URL: 'https://assets.totallyacdn.com', ROOT_URL: 'https://www.windscribe.com', TEST_LOCATION: { locationId: 7, diff --git a/modules/ext/src/utils/public-ip.js b/modules/ext/src/utils/public-ip.js index 50c0666..dbe1b54 100644 --- a/modules/ext/src/utils/public-ip.js +++ b/modules/ext/src/utils/public-ip.js @@ -1,6 +1,11 @@ export default async () => { - const response = await fetch('https://checkipv4.windscribe.com').then(r => - r.text(), - ) - return response.trim() + const controller = new AbortController() + setTimeout(() => controller.abort(), 3000) + + const response = await fetch('https://checkipv4.windscribe.com', { + signal: controller.signal, + }) + .then(r => r.text()) + .catch(() => '---.---.---.---') + return response } diff --git a/modules/ext/src/views/PreferencesBlocker/index.js b/modules/ext/src/views/PreferencesBlocker/index.js index 3c15846..ad28b44 100644 --- a/modules/ext/src/views/PreferencesBlocker/index.js +++ b/modules/ext/src/views/PreferencesBlocker/index.js @@ -174,7 +174,7 @@ export default () => { {advancedModeEnabled && ( browser.tabs.create({ url: 'options-ui/index.html' })} /> )} diff --git a/modules/ws-api-client/src/api/sendRequest.ts b/modules/ws-api-client/src/api/sendRequest.ts index 60360cd..df573b9 100644 --- a/modules/ws-api-client/src/api/sendRequest.ts +++ b/modules/ws-api-client/src/api/sendRequest.ts @@ -60,7 +60,7 @@ const sendRequest = async ({ const { lastCallTimeStamps = {}, apiCallMinInterval } = getConfig() const params = useBackup && endpoint.includes('ExtBlocklists') // Only need to add `domain` on ExtBlocklists - ? { ...defaultParams, domain: 'staticnetcontent.com' } + ? { ...defaultParams, domain: 'totallyacdn.com' } : defaultParams const apiUrl = prepareValidUrl({ url: endpoint, assets, useBackup }) @@ -82,7 +82,19 @@ const sendRequest = async ({ setConfig({ lastCallTimeStamps: { ...lastCallTimeStamps, [endpoint]: Date.now() }, }) - const response = await _fetch(url, config) + + const controller = new AbortController() + + setTimeout(() => controller.abort(), 3000) + let params: RequestInit = { + headers: config.headers as HeadersInit, + method: config.method, + body: config.body, + signal: controller.signal, + } + + const response = await fetch(url, params) + if (response.status === 404) { throw { code: response.status,