Skip to content

Commit

Permalink
feat: 脚本链接的末尾加上 #noCache 关闭缓存
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Nov 14, 2023
1 parent 3e30a35 commit f3de132
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
11 changes: 9 additions & 2 deletions backend/src/core/proxy-utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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(
Expand Down

0 comments on commit f3de132

Please sign in to comment.