@@ -30,6 +30,8 @@ const Inspector = @import("../browser/env.zig").Env.Inspector;
3030const Incrementing = @import ("../id.zig" ).Incrementing ;
3131const Notification = @import ("../notification.zig" ).Notification ;
3232
33+ const polyfill = @import ("../browser/polyfill/polyfill.zig" );
34+
3335pub const URL_BASE = "chrome://newtab/" ;
3436pub const LOADER_ID = "LOADERID24DD2FD56CF1EF33C965C79C" ;
3537
@@ -554,6 +556,10 @@ const IsolatedWorld = struct {
554556 executor : Env.ExecutionWorld ,
555557 grant_universal_access : bool ,
556558
559+ // Polyfill loader for the isolated world.
560+ // We want to load polyfill in the world's context.
561+ polyfill_loader : polyfill.Loader = .{},
562+
557563 pub fn deinit (self : * IsolatedWorld ) void {
558564 self .executor .deinit ();
559565 }
@@ -569,7 +575,13 @@ const IsolatedWorld = struct {
569575 // Currently we have only 1 page/frame and thus also only 1 state in the isolate world.
570576 pub fn createContext (self : * IsolatedWorld , page : * Page ) ! void {
571577 if (self .executor .js_context != null ) return error .Only1IsolatedContextSupported ;
572- _ = try self .executor .createJsContext (& page .window , page , {}, false , null );
578+ _ = try self .executor .createJsContext (
579+ & page .window ,
580+ page ,
581+ {},
582+ false ,
583+ Env .GlobalMissingCallback .init (& self .polyfill_loader ),
584+ );
573585 }
574586};
575587
0 commit comments