mirror of
https://github.com/sub-store-org/Sub-Store.git
synced 2026-11-30 08:28:10 +00:00
feat: 调整 env backend 判断
This commit is contained in:
3 files changed
+22
-11
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sub-store",
|
||||
"version": "2.21.29",
|
||||
"version": "2.21.32",
|
||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -13,15 +13,25 @@ const {
|
||||
isGUIforCores,
|
||||
} = ENV();
|
||||
let backend = 'Node';
|
||||
if (isNode) backend = 'Node';
|
||||
if (isQX) backend = 'QX';
|
||||
if (isLoon) backend = 'Loon';
|
||||
if (isSurge) backend = 'Surge';
|
||||
if (isStash) backend = 'Stash';
|
||||
if (isShadowRocket) backend = 'Shadowrocket';
|
||||
if (isEgern) backend = 'Egern';
|
||||
if (isLanceX) backend = 'LanceX';
|
||||
if (isGUIforCores) backend = 'GUI.for.Cores';
|
||||
if (isNode) {
|
||||
backend = 'Node';
|
||||
} else if (isQX) {
|
||||
backend = 'QX';
|
||||
} else if (isLoon) {
|
||||
backend = 'Loon';
|
||||
} else if (isStash) {
|
||||
backend = 'Stash';
|
||||
} else if (isShadowRocket) {
|
||||
backend = 'Shadowrocket';
|
||||
} else if (isEgern) {
|
||||
backend = 'Egern';
|
||||
} else if (isSurge) {
|
||||
backend = 'Surge';
|
||||
} else if (isLanceX) {
|
||||
backend = 'LanceX';
|
||||
} else if (isGUIforCores) {
|
||||
backend = 'GUI.for.Cores';
|
||||
}
|
||||
|
||||
let meta = {};
|
||||
let feature = {};
|
||||
|
||||
Vendored
+2
-1
@@ -1,12 +1,13 @@
|
||||
/* eslint-disable no-undef */
|
||||
const isQX = typeof $task !== 'undefined';
|
||||
const isLoon = typeof $loon !== 'undefined';
|
||||
// 可能有一些兼容环境依赖于这个, 先不改成 $environment.surge-version
|
||||
const isSurge = typeof $httpClient !== 'undefined' && !isLoon;
|
||||
const isNode = eval(`typeof process !== "undefined"`); // eval is needed in order to avoid browserify processing
|
||||
const isStash =
|
||||
'undefined' !== typeof $environment && $environment['stash-version'];
|
||||
const isShadowRocket = 'undefined' !== typeof $rocket;
|
||||
const isEgern = 'object' == typeof egern;
|
||||
const isEgern = 'undefined' !== typeof Egern && Egern.version;
|
||||
const isLanceX = 'undefined' != typeof $native;
|
||||
const isGUIforCores = typeof $Plugins !== 'undefined';
|
||||
import { Base64 } from 'js-base64';
|
||||
|
||||
Reference in new issue
Block a user