fix(navigation): expose native NavigationDestination bindings

This commit is contained in:
ldm0
2026-11-22 02:01:53 +08:00
parent abecad0fdd
commit d98c1fd31e
2 changed files with 4 additions and 6 deletions
@@ -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,
@@ -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::<v8::Object>::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))