What's the best way to integrate seb APIs (setTimeout, fetch, etc.) in V8

Viewed 154

For a project I'm working on, I need to use v8 In Go to run JS code. I'm using the v8Go library. However, I can't use things like fetch, setTimeout, and other Web APIs. I know that Web APIs are not v8's job to handle, but is there any way I can use these features without manually reimplementing them?

Note: I know I could just use NodeJS, which is just v8 with some of these features, but I need an efficient way to start JS processes, run code, then destroy them. Also, it wouldn't be exactly the same(for example window would be undefined), and being able to run frontend JS without having to change it is important for me.

1 Answers

Since these functions are not implemented in V8, you won't be able ton call them unless you reimplement them. But isn't a loss of time ?

As I understand, your true goal is to execute frontend JS. I think that you are referring to browsing a website.

Please take a look at chromedp

Related