mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-16 16:28:58 +00:00
browser: catch evalJS error and log them
This commit is contained in:
@@ -262,7 +262,7 @@ pub const Page = struct {
|
|||||||
// > immediately before the browser continues to parse the
|
// > immediately before the browser continues to parse the
|
||||||
// > page.
|
// > page.
|
||||||
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#notes
|
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#notes
|
||||||
try self.evalScript(e);
|
self.evalScript(e) catch |err| log.warn("evaljs: {any}", .{err});
|
||||||
},
|
},
|
||||||
else => continue,
|
else => continue,
|
||||||
}
|
}
|
||||||
@@ -277,7 +277,7 @@ pub const Page = struct {
|
|||||||
|
|
||||||
// eval async scripts.
|
// eval async scripts.
|
||||||
for (sasync.items) |e| {
|
for (sasync.items) |e| {
|
||||||
try self.evalScript(e);
|
self.evalScript(e) catch |err| log.warn("evaljs: {any}", .{err});
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO wait for async scripts
|
// TODO wait for async scripts
|
||||||
|
|||||||
Reference in New Issue
Block a user