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: 兼容某些格式的 Trojan URI(首个 # 之后的字符串均视为节点名称)
This commit is contained in:
parent
ea88cc1794
commit
9c78b87834
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sub-store",
|
||||
"version": "2.14.86",
|
||||
"version": "2.14.87",
|
||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
|
@ -463,8 +463,16 @@ function URI_Trojan() {
|
||||
};
|
||||
|
||||
const parse = (line) => {
|
||||
let [newLine, name] = line.split(/#(.+)/, 2);
|
||||
const parser = getTrojanURIParser();
|
||||
const proxy = parser.parse(line);
|
||||
const proxy = parser.parse(newLine);
|
||||
if (isNotBlank(name)) {
|
||||
try {
|
||||
proxy.name = decodeURIComponent(name);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
return proxy;
|
||||
};
|
||||
return { name, test, parse };
|
||||
|
Loading…
x
Reference in New Issue
Block a user