fix: javascript engine xhr polyfill (#581)

This commit is contained in:
Levi authored and GitHub committed 2024-06-15 11:40:12 +08:00
1 parent 2ee73ab619
commit 8b3b5d4394
4 files changed
+55 -16

No files matched your search

+4
View File
@@ -145,6 +145,10 @@ func NewEngine(cfg *Config) *Engine {
if err := runtime.Set("global", runtime.GlobalObject()); err != nil {
return
}
// polyfill window
if err := runtime.Set("window", runtime.GlobalObject()); err != nil {
return
}
// polyfill window.location
if _, err := runtime.RunString("global.location = new URL('http://localhost');"); err != nil {
return