Comments (5)
已修改,我没有 Shadowrocket 及 Stash,烦请测试,谢谢!
from task.
已修改,我没有 Shadowrocket 及 Stash,烦请测试,谢谢!
以下是刚刚测试的日志,我注意到$environment.system依然在😂
Can't find variable: $environment in method global code@ line: 16, column: 49
from task.
已修改,我没有 Shadowrocket 及 Stash,烦请测试,谢谢!
佬,帮忙改一下吧,😫,
from task.
很抱歉,没有 Shadowrocket,无法进行进一步测试。如果真的有此报错,大概率是 Shadowrocket 自身问题。node 和浏览器的 JavaScript 控制台也没有 $environment 接口,这次的写法和之前的写法均不会引起报错。&&
在 JavaScript 中从左至右有短路运算,第一个表达式返回 false 之后理应直接返回 false(参考: MDN)。之前写法中 Shadowrocket 的通知接口第四个参数有误,已进行修改。
你说的问题可以直接通过:
const isQuanX = typeof $notify != "undefined";
const isSurgeiOS1 =
typeof $utils != "undefined" &&
$environment["surge-version"] &&
$environment.system == "iOS";
const isSurgeiOS2 =
"undefined" !== typeof $environment &&
$environment["surge-version"] &&
$environment.system == "iOS";
const isLooniOS = typeof $loon != "undefined" && /iPhone/.test($loon);
const isStashiOS =
"undefined" !== typeof $environment &&
$environment["stash-version"] &&
$environment.system == "iOS";
const isShadowrocket = "undefined" !== typeof $rocket;
const isLanceX = "undefined" != typeof $native;
const platform = {isQuanX, isSurgeiOS1, isSurgeiOS2, isLooniOS, isStashiOS, isShadowrocket, isLanceX}
console.log(JSON.stringify(platform))
$done()
进行测试,其中 isSurgeiOS1
是老的写法,isSurgeiOS2
是新的写法,这段代码在 Surge 和 Quantumult X 中均未报错,删除 $done()
后在 node 和 MDN 中运行也未报错。
from task.
很抱歉,没有 Shadowrocket,无法进行进一步测试。如果真的有此报错,大概率是 Shadowrocket 自身问题。node 和浏览器的 JavaScript 控制台也没有 $environment 接口,这次的写法和之前的写法均不会引起报错。
&&
在 JavaScript 中从左至右有短路运算,第一个表达式返回 false 之后理应直接返回 false(参考: MDN)。之前写法中 Shadowrocket 的通知接口第四个参数有误,已进行修改。你说的问题可以直接通过:
const isQuanX = typeof $notify != "undefined"; const isSurgeiOS1 = typeof $utils != "undefined" && $environment["surge-version"] && $environment.system == "iOS"; const isSurgeiOS2 = "undefined" !== typeof $environment && $environment["surge-version"] && $environment.system == "iOS"; const isLooniOS = typeof $loon != "undefined" && /iPhone/.test($loon); const isStashiOS = "undefined" !== typeof $environment && $environment["stash-version"] && $environment.system == "iOS"; const isShadowrocket = "undefined" !== typeof $rocket; const isLanceX = "undefined" != typeof $native; const platform = {isQuanX, isSurgeiOS1, isSurgeiOS2, isLooniOS, isStashiOS, isShadowrocket, isLanceX} console.log(JSON.stringify(platform)) $done()进行测试,其中
isSurgeiOS1
是老的写法,isSurgeiOS2
是新的写法,这段代码在 Surge 和 Quantumult X 中均未报错,删除$done()
后在 node 和 MDN 中运行也未报错。
刚刚测试了最新的Unblock脚本 小火箭已经可以使用了。谢谢大佬解答
from task.
Related Issues (20)
- 请问可以支持一下 surge module 吗? HOT 1
- 小黑盒无法获取cookie HOT 1
- 百度UA打开百度系列产品网页显示空白 HOT 2
- 微博跳转到vvebo打开 HOT 6
- 奈雪的茶无法获取到cookie
- 你好,滴滴签到的使用问题
- heybox 小黑盒签到慎用!
- 既然有滴滴了,不如加上花小猪
- 关于如何在docker上运行滴滴活动脚本 HOT 3
- 5.8滴滴提示接口出错 HOT 2
- 滴滴脚本提示步数接口错误 HOT 1
- Q-Search URL Encode
- 奈雪和海底捞404了 HOT 2
- 航旅纵横失效
- 【Oclean】能不能求大佬移植Oclean的签到到青龙上 HOT 1
- 微信外链脚本重复通知
- Oclean的任务更新了,希望能更新下圈x签到脚本
- 微博检测个人更新还能用吗
- oclean签到以后没有等级经验
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from task.