Open ka3de opened 1 year ago
I've been experimenting with this a little bit.
If we want to remove references to Goja in our "core implementation", we should define an abstraction for browser [launch] options. And set this as the input for BrowserType.Launch
and BrowserType.Connect
methods. This abstraction should aim to be compatible with other browsers, not just Chromium.
Then we can transform the goja.Value
object received from JS API into this new browser options type/abstraction in the connect
and launch
handlers in the mapping layer before calling the actual BrowserType
method.
During the work done in #800, there was a proposal for optimization for the browser options parsing, now that this has to be done for both
BrowserType.launch
andBrowserType.connect
methods.This proposal also references the "global effort" in order to isolate as much as possible any Goja runtime reference and move it to the mapping layer.
Related: https://github.com/grafana/xk6-browser/issues/271.