mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-06-21 10:19:15 +03:00
Add Surge MITM and scripts
This commit is contained in:
18
script/jsc/time.go
Normal file
18
script/jsc/time.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package jsc
|
||||
|
||||
import (
|
||||
"time"
|
||||
_ "unsafe"
|
||||
|
||||
"github.com/dop251/goja"
|
||||
)
|
||||
|
||||
func TimeToValue(runtime *goja.Runtime, time time.Time) goja.Value {
|
||||
return runtimeNewDateObject(runtime, time, true, runtimeGetDatePrototype(runtime))
|
||||
}
|
||||
|
||||
//go:linkname runtimeNewDateObject github.com/dop251/goja.(*Runtime).newDateObject
|
||||
func runtimeNewDateObject(r *goja.Runtime, t time.Time, isSet bool, proto *goja.Object) *goja.Object
|
||||
|
||||
//go:linkname runtimeGetDatePrototype github.com/dop251/goja.(*Runtime).getDatePrototype
|
||||
func runtimeGetDatePrototype(r *goja.Runtime) *goja.Object
|
||||
Reference in New Issue
Block a user