mirror of
https://github.com/krau/SaveAny-Bot.git
synced 2026-07-12 16:02:05 +08:00
feat: add Playwright support for browser automation in plugins
- Updated .dockerignore and .gitignore to exclude Playwright-related files. - Added Playwright-Go dependency in go.mod and updated go.sum. - Implemented jsPlaywright function in js_api.go for browser-based requests. - Enhanced README.md to document the new Playwright functionality for plugins.
This commit is contained in:
@@ -121,7 +121,9 @@ func LoadPlugins(ctx context.Context, dir string) error {
|
||||
vm.Set("console", jsConsole(logger))
|
||||
// http fetch funcs
|
||||
vm.Set("ghttp", jsGhttp(vm))
|
||||
|
||||
// playwright fetch func
|
||||
vm.Set("playwright", jsPlaywright(vm, logger))
|
||||
|
||||
if _, err := vm.RunString(string(code)); err != nil {
|
||||
return fmt.Errorf("error loading plugin %s: %w", e.Name(), err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user