File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,10 @@ import (
4343func TestWebBrowser (t *testing .T ) {
4444 t.Parallel ()
4545 b := browser.New (
46+ browser.WithScriptEngine (v8engine.DefaultEngine ()),
47+ // Alternatively (adjust imports accordingly), using Sobek, a pure Go
48+ // JavaScript engine:
49+ // browser.WithScriptEngine(sobekengine.DefaultEngine()),
4650 browser.WithHandler (server.RootHttpHandler ),
4751 browser.WithLogger (gosttest.NewTestingLogger (t)),
4852 browser.WithContext (t.Context ()),
@@ -60,6 +64,7 @@ Breakdown of the code:
6064
6165- ` browser.New ` obviously creates a new browser instance. By default, this will
6266 be configured with a V8 script engine.
67+ - ` browser.WithScriptEngine ` passes a script engine to use.
6368 - ` browser.WithHandler ` is the recommended way, connect the browser directly
6469 to the root HTTP handler, bypassing the TCP stack. This is not necessary.
6570 Without it, you need to start the server on a TCP port, as well as remember
You can’t perform that action at this time.
0 commit comments