From f3de132d707ccae91d57bde465b90fe455e3b4d3 Mon Sep 17 00:00:00 2001 From: xream Date: Tue, 14 Nov 2023 21:14:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=84=9A=E6=9C=AC=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E7=9A=84=E6=9C=AB=E5=B0=BE=E5=8A=A0=E4=B8=8A=20#noCache=20?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/package.json | 2 +- backend/src/core/proxy-utils/index.js | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/backend/package.json b/backend/package.json index 4e6947962..2399c898c 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.89", + "version": "2.14.90", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/core/proxy-utils/index.js b/backend/src/core/proxy-utils/index.js index 4b48c5f92..1a2c7375e 100644 --- a/backend/src/core/proxy-utils/index.js +++ b/backend/src/core/proxy-utils/index.js @@ -71,7 +71,12 @@ async function process(proxies, operators = [], targetPlatform, source) { if (item.type.indexOf('Script') !== -1) { const { mode, content } = item.args; if (mode === 'link') { - const url = content; + let noCache; + let url = content; + if (url.endsWith('#noCache')) { + url = url.replace(/#noCache$/, ''); + noCache = true; + } // extract link arguments const rawArgs = url.split('#'); if (rawArgs.length > 1) { @@ -93,7 +98,9 @@ async function process(proxies, operators = [], targetPlatform, source) { // if this is a remote script, download it try { - script = await download(url.split('#')[0]); + script = await download( + `${url.split('#')[0]}${noCache ? '#noCache' : ''}`, + ); // $.info(`Script loaded: >>>\n ${script}`); } catch (err) { $.error(