Skip to content

Commit

Permalink
Update eval_script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
yichahucha authored Jun 19, 2020
1 parent 243bcbc commit c9d55e4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion eval_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const __conf = String.raw`
[Remote]
// custom remote...
https://raw.githubusercontent.com/yichahucha/surge/master/qx_sub.txt
# https://raw.githubusercontent.com/yichahucha/surge/master/qx_sub.txt
[Local]
Expand Down Expand Up @@ -643,6 +643,7 @@ function ____Tool() {
return (null)
}
})()
_isJsBox = typeof $jsbox != "undefined"
_isSurge = typeof $httpClient != "undefined"
_isQuanX = typeof $task != "undefined"
_isTask = typeof $request == "undefined"
Expand Down Expand Up @@ -674,6 +675,10 @@ function ____Tool() {
if (_isQuanX) $notify(title, subtitle, message)
if (_isSurge) $notification.post(title, subtitle, message)
if (_node) console.log(JSON.stringify({ title, subtitle, message }));
if (_isJsBox) {
const push = require("push");
push.schedule({ title: title, body: `${subtitle}${subtitle.length > 0 ? "\n" : ""}${message}` });
}
}
this.write = (value, key) => {
if (_isQuanX) return $prefs.setValueForKey(value, key)
Expand Down

0 comments on commit c9d55e4

Please sign in to comment.