mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-11 16:09:01 +08:00
feat: 脚本链接的末尾加上 #noCache 关闭缓存
This commit is contained in:
parent
3e30a35bc4
commit
f3de132d70
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sub-store",
|
"name": "sub-store",
|
||||||
"version": "2.14.89",
|
"version": "2.14.90",
|
||||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
||||||
"main": "src/main.js",
|
"main": "src/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -71,7 +71,12 @@ async function process(proxies, operators = [], targetPlatform, source) {
|
|||||||
if (item.type.indexOf('Script') !== -1) {
|
if (item.type.indexOf('Script') !== -1) {
|
||||||
const { mode, content } = item.args;
|
const { mode, content } = item.args;
|
||||||
if (mode === 'link') {
|
if (mode === 'link') {
|
||||||
const url = content;
|
let noCache;
|
||||||
|
let url = content;
|
||||||
|
if (url.endsWith('#noCache')) {
|
||||||
|
url = url.replace(/#noCache$/, '');
|
||||||
|
noCache = true;
|
||||||
|
}
|
||||||
// extract link arguments
|
// extract link arguments
|
||||||
const rawArgs = url.split('#');
|
const rawArgs = url.split('#');
|
||||||
if (rawArgs.length > 1) {
|
if (rawArgs.length > 1) {
|
||||||
@ -93,7 +98,9 @@ async function process(proxies, operators = [], targetPlatform, source) {
|
|||||||
|
|
||||||
// if this is a remote script, download it
|
// if this is a remote script, download it
|
||||||
try {
|
try {
|
||||||
script = await download(url.split('#')[0]);
|
script = await download(
|
||||||
|
`${url.split('#')[0]}${noCache ? '#noCache' : ''}`,
|
||||||
|
);
|
||||||
// $.info(`Script loaded: >>>\n ${script}`);
|
// $.info(`Script loaded: >>>\n ${script}`);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
$.error(
|
$.error(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user