From d98c1fd31e1fae1083dc65b03dfd57fd0696db1f Mon Sep 17 00:00:00 2001 From: ldm0 Date: Thu, 24 Sep 2026 05:44:46 +0800 Subject: [PATCH] fix(navigation): expose native NavigationDestination bindings --- .../src/context_bootstrap/events/subclasses/data.rs | 4 ++-- moli-renderer-v8/src/context_bootstrap/navigation_events.rs | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/moli-renderer-v8/src/context_bootstrap/events/subclasses/data.rs b/moli-renderer-v8/src/context_bootstrap/events/subclasses/data.rs index ce7d4b296a5..d393de0c43e 100644 --- a/moli-renderer-v8/src/context_bootstrap/events/subclasses/data.rs +++ b/moli-renderer-v8/src/context_bootstrap/events/subclasses/data.rs @@ -7,8 +7,8 @@ use crate::context_bootstrap::history_mutation::document_can_have_url_rewritten; use crate::context_bootstrap::location_runtime::location_href_slot; use crate::context_bootstrap::navigation_activation::{NAVIGATE_EVENT_PRECOMMIT_TRANSITION_RESOLVER_SLOT, install_navigation_transition}; use crate::context_bootstrap::navigation_events::{ - NAVIGATE_EVENT_PRECOMMIT_CONTROLLER_SLOT, navigation_destination_url_value, navigation_scroll_event_is_active, - set_navigation_destination_url, + NAVIGATE_EVENT_PRECOMMIT_CONTROLLER_SLOT, navigation_destination_url_value, + navigation_scroll_event_is_active, set_navigation_destination_url, }; use crate::context_bootstrap::navigation_handler_callbacks::{ NAVIGATE_EVENT_ADDED_HANDLERS_SLOT, NAVIGATE_EVENT_DEFERRED_HANDLERS_SLOT, diff --git a/moli-renderer-v8/src/context_bootstrap/navigation_events.rs b/moli-renderer-v8/src/context_bootstrap/navigation_events.rs index bb53a3d2a4e..e13ee605688 100644 --- a/moli-renderer-v8/src/context_bootstrap/navigation_events.rs +++ b/moli-renderer-v8/src/context_bootstrap/navigation_events.rs @@ -909,10 +909,8 @@ pub(super) fn navigation_precommit_redirect<'s>( let destination = event .get(scope, v8str(scope, "destination").into()) .and_then(|value| v8::Local::::try_from(value).ok()); - let url = destination - .and_then(|destination| destination.get(scope, v8str(scope, "url").into())) - .and_then(|value| value.to_string(scope)) - .map(|value| value.to_rust_string_lossy(scope)); + let url = + destination.and_then(|destination| navigation_destination_url_value(scope, destination)); let history = navigate_event_private_value(scope, event, NAVIGATE_EVENT_REDIRECT_HISTORY_SLOT) .and_then(|value| value.to_string(scope)) .map(|value| value.to_rust_string_lossy(scope))