mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-06-12 06:18:16 +03:00
mitm: Refactor & Add url
This commit is contained in:
21
script/jstest/test.go
Normal file
21
script/jstest/test.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package jstest
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
|
||||
"github.com/sagernet/sing-box/script/modules/require"
|
||||
)
|
||||
|
||||
//go:embed assert.js
|
||||
var assertJS []byte
|
||||
|
||||
func NewRegistry() *require.Registry {
|
||||
return require.NewRegistry(require.WithFsEnable(true), require.WithLoader(func(path string) ([]byte, error) {
|
||||
switch path {
|
||||
case "assert.js":
|
||||
return assertJS, nil
|
||||
default:
|
||||
return require.DefaultSourceLoader(path)
|
||||
}
|
||||
}))
|
||||
}
|
||||
Reference in New Issue
Block a user