Skip to content

Fetch polyfill #312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions LICENSING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The following files are licensed under MIT:

```
src/http/Client.zig
src/polyfill/fetch.js
```

The following directories and their subdirectories are licensed under their
Expand Down
5 changes: 5 additions & 0 deletions src/browser/browser.zig
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ const FetchResult = @import("../http/Client.zig").Client.FetchResult;
const UserContext = @import("../user_context.zig").UserContext;
const HttpClient = @import("asyncio").Client;

const polyfill = @import("../polyfill/polyfill.zig");

const log = std.log.scoped(.browser);

// Browser is an instance of the browser.
Expand Down Expand Up @@ -355,6 +357,9 @@ pub const Page = struct {
log.debug("start js env", .{});
try self.session.env.start();

// load polyfills
try polyfill.load(alloc, self.session.env);

// inspector
if (self.session.inspector) |inspector| {
inspector.contextCreated(self.session.env, "", self.origin.?, auxData);
Expand Down
Loading
Loading