mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-10 09:09:00 +08:00
feat: 脚本链接的末尾加上 #noCache 关闭缓存
This commit is contained in:
parent
3e30a35bc4
commit
f3de132d70
@ -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": {
|
||||
|
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user