Skip to content

Commit c787b6a

Browse files
Merge pull request #312 from lightpanda-io/fetch-polyfill
Fetch polyfill
2 parents 766aa0f + fbe8835 commit c787b6a

File tree

7 files changed

+794
-0
lines changed

7 files changed

+794
-0
lines changed

LICENSING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The following files are licensed under MIT:
1111

1212
```
1313
src/http/Client.zig
14+
src/polyfill/fetch.js
1415
```
1516

1617
The following directories and their subdirectories are licensed under their

src/browser/browser.zig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ const FetchResult = @import("../http/Client.zig").Client.FetchResult;
4242
const UserContext = @import("../user_context.zig").UserContext;
4343
const HttpClient = @import("asyncio").Client;
4444

45+
const polyfill = @import("../polyfill/polyfill.zig");
46+
4547
const log = std.log.scoped(.browser);
4648

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

360+
// load polyfills
361+
try polyfill.load(alloc, self.session.env);
362+
358363
// inspector
359364
if (self.session.inspector) |inspector| {
360365
inspector.contextCreated(self.session.env, "", self.origin.?, auxData);

0 commit comments

Comments
 (0)