mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-17 08:48:58 +00:00
Remove BrowserContext URL
Add BrowserContext.getURL which gets the URL from the session.page.
This commit is contained in:
@@ -61,10 +61,10 @@ fn getFrameTree(cmd: anytype) !void {
|
||||
return cmd.sendResult(.{
|
||||
.frameTree = .{
|
||||
.frame = Frame{
|
||||
.url = bc.url,
|
||||
.id = target_id,
|
||||
.loaderId = bc.loader_id,
|
||||
.securityOrigin = bc.security_origin,
|
||||
.url = bc.getURL() orelse "about:blank",
|
||||
.secureContextType = bc.secure_context_type,
|
||||
},
|
||||
},
|
||||
@@ -154,7 +154,6 @@ pub fn navigateToUrl(cmd: anytype, url: []const u8, send_result: bool) !void {
|
||||
|
||||
// change state
|
||||
bc.reset();
|
||||
bc.url = url;
|
||||
bc.loader_id = cmd.cdp.loader_id_gen.next();
|
||||
|
||||
const LifecycleEvent = struct {
|
||||
@@ -285,7 +284,7 @@ test "cdp.page: getFrameTree" {
|
||||
.frame = .{
|
||||
.id = "TID-3",
|
||||
.loaderId = bc.loader_id,
|
||||
.url = bc.url,
|
||||
.url = "about:blank",
|
||||
.domainAndRegistry = "",
|
||||
.securityOrigin = bc.security_origin,
|
||||
.mimeType = "text/html",
|
||||
|
||||
@@ -132,7 +132,6 @@ fn createTarget(cmd: anytype) !void {
|
||||
_ = try bc.session.createPage(aux_data);
|
||||
|
||||
// change CDP state
|
||||
bc.url = "about:blank";
|
||||
bc.security_origin = "://";
|
||||
bc.secure_context_type = "InsecureScheme";
|
||||
bc.loader_id = LOADER_ID;
|
||||
@@ -142,11 +141,11 @@ fn createTarget(cmd: anytype) !void {
|
||||
// has been enabled?
|
||||
try cmd.sendEvent("Target.targetCreated", .{
|
||||
.targetInfo = TargetInfo{
|
||||
.url = bc.url,
|
||||
.attached = false,
|
||||
.targetId = target_id,
|
||||
.title = "about:blank",
|
||||
.browserContextId = bc.id,
|
||||
.attached = false,
|
||||
.url = "about:blank",
|
||||
},
|
||||
}, .{});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user