Skip to main content

script/
navigation.rs

1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5//! The listener that encapsulates all state for an in-progress document request.
6//! Any redirects that are encountered are followed. Whenever a non-redirect
7//! response is received, it is forwarded to the appropriate script thread.
8
9use std::cell::Cell;
10
11use content_security_policy::sandboxing_directive::SandboxingFlagSet;
12use crossbeam_channel::Sender;
13use embedder_traits::user_contents::UserContentManagerId;
14use embedder_traits::{Theme, ViewportDetails, WebDriverLoadStatus};
15use http::header;
16use js::context::JSContext;
17use net_traits::blob_url_store::UrlWithBlobClaim;
18use net_traits::request::{
19    CredentialsMode, InsecureRequestsPolicy, Origin, PreloadedResources, RedirectMode,
20    RequestBuilder, RequestClient, RequestMode,
21};
22use net_traits::response::ResponseInit;
23use net_traits::{
24    BoxedFetchCallback, CoreResourceThread, DOCUMENT_ACCEPT_HEADER_VALUE, FetchResponseMsg,
25    Metadata, ReferrerPolicy, fetch_async, set_default_accept_language,
26};
27use script_bindings::inheritance::Castable;
28use script_traits::{DocumentActivity, NewPipelineInfo};
29use servo_base::cross_process_instant::CrossProcessInstant;
30use servo_base::id::{BrowsingContextId, PipelineId, WebViewId};
31use servo_constellation_traits::{
32    LoadData, LoadOrigin, NavigationHistoryBehavior, ScriptToConstellationMessage,
33    TargetSnapshotParams,
34};
35use servo_url::{ImmutableOrigin, MutableOrigin, ServoUrl};
36use url::Position;
37
38use crate::dom::bindings::codegen::Bindings::HTMLIFrameElementBinding::HTMLIFrameElementMethods;
39use crate::dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
40use crate::dom::bindings::refcounted::Trusted;
41use crate::dom::element::Element;
42use crate::dom::html::htmliframeelement::HTMLIFrameElement;
43use crate::dom::node::node::NodeTraits;
44use crate::dom::window::Window;
45use crate::dom::windowproxy::WindowProxy;
46use crate::event_loop::script_thread::ScriptThread;
47use crate::fetch::FetchCanceller;
48use crate::messaging::MainThreadScriptMsg;
49
50#[derive(Clone)]
51pub struct NavigationListener {
52    request_builder: RequestBuilder,
53    main_thread_sender: Sender<MainThreadScriptMsg>,
54    // Whether or not results are sent to the main thread. After a redirect results are no longer sent,
55    // as the main thread has already started a new request.
56    send_results_to_main_thread: Cell<bool>,
57}
58
59impl NavigationListener {
60    pub(crate) fn into_callback(self) -> BoxedFetchCallback {
61        Box::new(move |response_msg| self.notify_fetch(response_msg))
62    }
63
64    pub fn new(
65        request_builder: RequestBuilder,
66        main_thread_sender: Sender<MainThreadScriptMsg>,
67    ) -> NavigationListener {
68        NavigationListener {
69            request_builder,
70            main_thread_sender,
71            send_results_to_main_thread: Cell::new(true),
72        }
73    }
74
75    pub fn initiate_fetch(
76        self,
77        core_resource_thread: &CoreResourceThread,
78        response_init: Option<ResponseInit>,
79    ) {
80        fetch_async(
81            core_resource_thread,
82            self.request_builder.clone(),
83            response_init,
84            self.into_callback(),
85        );
86    }
87
88    fn notify_fetch(&self, message: FetchResponseMsg) {
89        // If we've already asked the main thread to redirect the response, then stop sending results
90        // for this fetch. The main thread has already replaced it.
91        if !self.send_results_to_main_thread.get() {
92            return;
93        }
94
95        // If this is a redirect, don't send any more message after this one.
96        if Self::http_redirect_metadata(&message).is_some() {
97            self.send_results_to_main_thread.set(false);
98        }
99
100        let pipeline_id = self
101            .request_builder
102            .pipeline_id
103            .expect("Navigation should always have an associated Pipeline");
104        let result = self
105            .main_thread_sender
106            .send(MainThreadScriptMsg::NavigationResponse {
107                pipeline_id,
108                message: Box::new(message),
109            });
110
111        if let Err(error) = result {
112            warn!(
113                "Failed to send network message to pipeline {:?}: {error:?}",
114                pipeline_id
115            );
116        }
117    }
118
119    pub(crate) fn http_redirect_metadata(message: &FetchResponseMsg) -> Option<&Metadata> {
120        let FetchResponseMsg::ProcessResponse(_, Ok(metadata)) = message else {
121            return None;
122        };
123
124        // Don't allow redirects for non HTTP(S) URLs.
125        let metadata = metadata.metadata();
126        if !matches!(
127            metadata.location_url,
128            Some(Ok(ref location_url)) if matches!(location_url.scheme(), "http" | "https")
129        ) {
130            return None;
131        }
132
133        Some(metadata)
134    }
135}
136
137/// A document load that is in the process of fetching the requested resource. Contains
138/// data that will need to be present when the document and frame tree entry are created,
139/// but is only easily available at initiation of the load and on a push basis (so some
140/// data will be updated according to future resize events, viewport changes, etc.)
141#[derive(JSTraceable)]
142pub(crate) struct InProgressLoad {
143    /// The pipeline which requested this load.
144    #[no_trace]
145    pub(crate) pipeline_id: PipelineId,
146    /// The browsing context being loaded into.
147    #[no_trace]
148    pub(crate) browsing_context_id: BrowsingContextId,
149    /// The top level ancestor browsing context.
150    #[no_trace]
151    pub(crate) webview_id: WebViewId,
152    /// The parent pipeline and frame type associated with this load, if any.
153    #[no_trace]
154    pub(crate) parent_info: Option<PipelineId>,
155    /// The opener, if this is an auxiliary.
156    #[no_trace]
157    pub(crate) opener: Option<BrowsingContextId>,
158    /// The current window size associated with this pipeline.
159    #[no_trace]
160    pub(crate) viewport_details: ViewportDetails,
161    /// The activity level of the document (inactive, active or fully active).
162    #[no_trace]
163    pub(crate) activity: DocumentActivity,
164    /// Window is throttled, running timers at a heavily limited rate.
165    pub(crate) throttled: bool,
166    /// Timestamp reporting the time when the browser started this load.
167    #[no_trace]
168    pub(crate) navigation_start: CrossProcessInstant,
169    /// For cancelling the fetch
170    pub(crate) canceller: FetchCanceller,
171    /// The [`LoadData`] associated with this load.
172    #[no_trace]
173    pub(crate) load_data: LoadData,
174    /// A list of URL to keep track of all the redirects that have happened during
175    /// this load.
176    #[no_trace]
177    pub(crate) url_list: Vec<ServoUrl>,
178    #[no_trace]
179    /// The [`UserContentManagerId`] associated with this load's `WebView`.
180    pub(crate) user_content_manager_id: Option<UserContentManagerId>,
181    /// The [`Theme`] to use for this page, once it loads.
182    #[no_trace]
183    pub(crate) embedder_theme: Theme,
184    /// The [`TargetSnapshotParams`] to use when creating this document.
185    #[no_trace]
186    pub(crate) target_snapshot_params: TargetSnapshotParams,
187}
188
189impl InProgressLoad {
190    /// Create a new InProgressLoad object.
191    pub(crate) fn new(new_pipeline_info: NewPipelineInfo) -> InProgressLoad {
192        let url = new_pipeline_info.load_data.url.clone();
193        InProgressLoad {
194            pipeline_id: new_pipeline_info.new_pipeline_id,
195            browsing_context_id: new_pipeline_info.browsing_context_id,
196            webview_id: new_pipeline_info.webview_id,
197            parent_info: new_pipeline_info.parent_info,
198            opener: new_pipeline_info.opener,
199            viewport_details: new_pipeline_info.viewport_details,
200            activity: DocumentActivity::FullyActive,
201            throttled: false,
202            navigation_start: CrossProcessInstant::now(),
203            canceller: Default::default(),
204            load_data: new_pipeline_info.load_data,
205            url_list: vec![url],
206            user_content_manager_id: new_pipeline_info.user_content_manager_id,
207            embedder_theme: new_pipeline_info.embedder_theme,
208            target_snapshot_params: new_pipeline_info.target_snapshot_params,
209        }
210    }
211
212    pub(crate) fn request_builder(&mut self) -> RequestBuilder {
213        let client_origin = match self.load_data.load_origin {
214            LoadOrigin::Script(ref initiator_origin) => initiator_origin.immutable().clone(),
215            _ => ImmutableOrigin::new_opaque(),
216        };
217
218        let id = self.pipeline_id;
219        let webview_id = self.webview_id;
220
221        let insecure_requests_policy = self
222            .load_data
223            .inherited_insecure_requests_policy
224            .unwrap_or(InsecureRequestsPolicy::DoNotUpgrade);
225
226        let request_client = RequestClient {
227            preloaded_resources: PreloadedResources::default(),
228            policy_container: self.load_data.policy_container.clone().unwrap_or_default(),
229            origin: Origin::Origin(client_origin),
230            is_nested_browsing_context: self.parent_info.is_some(),
231            insecure_requests_policy,
232            has_trustworthy_ancestor_origin: self.load_data.has_trustworthy_ancestor_origin,
233        };
234
235        let mut request_builder = RequestBuilder::new(
236            Some(webview_id),
237            UrlWithBlobClaim::from_url_without_having_claimed_blob(self.load_data.url.clone()),
238            self.load_data.referrer.clone(),
239        )
240        .method(self.load_data.method.clone())
241        .destination(self.load_data.destination)
242        .mode(RequestMode::Navigate)
243        .credentials_mode(CredentialsMode::Include)
244        .use_url_credentials(true)
245        .pipeline_id(Some(id))
246        .referrer_policy(self.load_data.referrer_policy)
247        .policy_container(self.load_data.policy_container.clone().unwrap_or_default())
248        .headers(self.load_data.headers.clone())
249        .body(self.load_data.data.clone())
250        .redirect_mode(RedirectMode::Manual)
251        .crash(self.load_data.crash.clone())
252        .client(request_client)
253        .url_list(self.url_list.clone());
254
255        request_builder.reload_navigation = self.load_data.reload_navigation;
256        request_builder.history_navigation = self.load_data.history_navigation;
257
258        if !request_builder.headers.contains_key(header::ACCEPT) {
259            request_builder
260                .headers
261                .insert(header::ACCEPT, DOCUMENT_ACCEPT_HEADER_VALUE);
262        }
263        set_default_accept_language(&mut request_builder.headers);
264
265        request_builder
266    }
267}
268
269/// <https://html.spec.whatwg.org/multipage/#determining-the-origin>
270pub(crate) fn determine_the_origin(
271    url: Option<&ServoUrl>,
272    sandbox_flags: SandboxingFlagSet,
273    source_origin: Option<MutableOrigin>,
274) -> MutableOrigin {
275    // Step 1. If sandboxFlags has its sandboxed origin browsing context flag set, then return a new opaque origin.
276    let is_sandboxed =
277        sandbox_flags.contains(SandboxingFlagSet::SANDBOXED_ORIGIN_BROWSING_CONTEXT_FLAG);
278    if is_sandboxed {
279        return MutableOrigin::new(ImmutableOrigin::new_opaque());
280    }
281
282    // Step 2. If url is null, then return a new opaque origin.
283    let Some(url) = url else {
284        return MutableOrigin::new(ImmutableOrigin::new_opaque());
285    };
286
287    // Step 3. If url is about:srcdoc, then:
288    if url.as_str() == "about:srcdoc" {
289        // Step 3.1 Assert: sourceOrigin is non-null.
290        let source_origin =
291            source_origin.expect("Can't have a null source origin for about:srcdoc");
292        // Step 3.2 Return sourceOrigin
293        return source_origin;
294    }
295
296    // Step 4. If url matches about:blank and sourceOrigin is non-null, then return sourceOrigin.
297    if url.as_str() == "about:blank" &&
298        let Some(source_origin) = source_origin
299    {
300        return source_origin;
301    }
302
303    // Step 5. Return url's origin.
304    MutableOrigin::new(url.origin())
305}
306
307/// <https://html.spec.whatwg.org/multipage/#navigate-fragid>
308fn navigate_to_fragment(
309    cx: &mut JSContext,
310    window: &Window,
311    url: &ServoUrl,
312    history_handling: NavigationHistoryBehavior,
313) {
314    let doc = window.Document();
315    // Step 1. Let navigation be navigable's active window's navigation API.
316    // TODO
317    // Step 2. Let destinationNavigationAPIState be navigable's active session history entry's navigation API state.
318    // TODO
319    // Step 3. If navigationAPIState is not null, then set destinationNavigationAPIState to navigationAPIState.
320    // TODO
321
322    // Step 4. Let continue be the result of firing a push/replace/reload navigate event
323    // at navigation with navigationType set to historyHandling, isSameDocument set to true,
324    // userInvolvement set to userInvolvement, sourceElement set to sourceElement,
325    // destinationURL set to url, and navigationAPIState set to destinationNavigationAPIState.
326    // TODO
327    // Step 5. If continue is false, then return.
328    // TODO
329
330    // Step 6. Let historyEntry be a new session history entry, with
331    // Step 7. Let entryToReplace be navigable's active session history entry if historyHandling is "replace", otherwise null.
332    // Step 8. Let history be navigable's active document's history object.
333    // Step 9. Let scriptHistoryIndex be history's index.
334    // Step 10. Let scriptHistoryLength be history's length.
335    // Step 11. If historyHandling is "push", then:
336    // Step 13. Set navigable's active session history entry to historyEntry.
337    window.send_to_constellation(ScriptToConstellationMessage::NavigatedToFragment(
338        url.clone(),
339        history_handling,
340    ));
341    // Step 12. Set navigable's active document's URL to url.
342    let old_url = doc.url();
343    doc.set_url(url.clone());
344    // Step 14. Update document for history step application given navigable's active document,
345    // historyEntry, true, scriptHistoryIndex, scriptHistoryLength, and historyHandling.
346    doc.update_document_for_history_step_application(&old_url, url);
347    // Step 15. Scroll to the fragment given navigable's active document.
348    let Some(fragment) = url.fragment() else {
349        unreachable!("Must always have a fragment");
350    };
351    doc.scroll_to_the_fragment(cx, fragment);
352    // Step 16. Let traversable be navigable's traversable navigable.
353    // TODO
354    // Step 17. Append the following session history synchronous navigation steps involving navigable to traversable:
355    // TODO
356}
357
358/// <https://html.spec.whatwg.org/multipage/#navigate>
359pub(crate) fn navigate(
360    cx: &mut JSContext,
361    window: &Window,
362    history_handling: NavigationHistoryBehavior,
363    force_reload: bool,
364    mut load_data: LoadData,
365) {
366    let doc = window.Document();
367
368    // <https://html.spec.whatwg.org/multipage/#process-a-navigate-fetch>
369    if force_reload {
370        // Step 7. If entry's document state's reload pending is true, then set request's reload-navigation flag.
371        load_data.reload_navigation = true;
372    }
373
374    // Step 3. Let initiatorOriginSnapshot be sourceDocument's origin.
375    let initiator_origin_snapshot = &load_data.load_origin;
376
377    // TODO: Important re security. See https://github.com/servo/servo/issues/23373
378    // Step 5. check that the source browsing-context is "allowed to navigate" this window.
379
380    // Step 4 and 5
381    let pipeline_id = window.pipeline_id();
382    let window_proxy = window.window_proxy();
383    if let Some(active) = window_proxy.currently_active() &&
384        pipeline_id == active &&
385        doc.is_prompting_or_unloading()
386    {
387        return;
388    }
389
390    // Step 12. If historyHandling is "auto", then:
391    let history_handling = if history_handling == NavigationHistoryBehavior::Auto {
392        // Step 12.1. If url equals navigable's active document's URL, and
393        // initiatorOriginSnapshot is same origin with targetNavigable's active document's
394        // origin, then set historyHandling to "replace".
395        //
396        // Note: `targetNavigable` is not actually defined in the spec, "active document" is
397        // assumed to be the correct reference based on WPT results
398        if let LoadOrigin::Script(initiator_origin) = initiator_origin_snapshot {
399            if load_data.url == doc.url() && initiator_origin.same_origin(&*doc.origin()) {
400                NavigationHistoryBehavior::Replace
401            } else {
402                // Step 12.2. Otherwise, set historyHandling to "push".
403                NavigationHistoryBehavior::Push
404            }
405        } else {
406            // Step 12.2. Otherwise, set historyHandling to "push".
407            NavigationHistoryBehavior::Push
408        }
409    } else {
410        history_handling
411    };
412
413    // Step 13. If the navigation must be a replace given url and navigable's active
414    // document, then set historyHandling to "replace".
415    //
416    // Inlines implementation of https://html.spec.whatwg.org/multipage/#the-navigation-must-be-a-replace
417    let history_handling = if load_data.url.scheme() == "javascript" || doc.is_initial_about_blank()
418    {
419        NavigationHistoryBehavior::Replace
420    } else {
421        history_handling
422    };
423
424    // Step 14. If all of the following are true:
425    // > documentResource is null;
426    // > response is null;
427    if !force_reload
428        // > url equals navigable's active session history entry's URL with exclude fragments set to true; and
429        && load_data.url.as_url()[..Position::AfterQuery] ==
430            doc.url().as_url()[..Position::AfterQuery]
431        // > url's fragment is non-null,
432        && load_data.url.fragment().is_some()
433    {
434        // Step 14.1. Navigate to a fragment given navigable, url, historyHandling,
435        // userInvolvement, sourceElement, navigationAPIState, and navigationId.
436        let webdriver_sender = window.webdriver_load_status_sender();
437        if let Some(ref sender) = webdriver_sender {
438            let _ = sender.send(WebDriverLoadStatus::NavigationStart);
439        }
440        navigate_to_fragment(cx, window, &load_data.url, history_handling);
441        // Step 14.2. Return.
442        if let Some(sender) = webdriver_sender {
443            let _ = sender.send(WebDriverLoadStatus::NavigationStop);
444        }
445        return;
446    }
447
448    // Step 15. If navigable's parent is non-null, then set navigable's is delaying load events to true.
449    let window_proxy = window.window_proxy();
450    if window_proxy.parent().is_some() {
451        window_proxy.start_delaying_load_events_mode();
452    }
453
454    // Step 16. Let targetSnapshotParams be the result of snapshotting target
455    // snapshot params given navigable.
456    let target_snapshot_params = snapshot_target_snapshot_params(&window_proxy);
457
458    // Step 17. Invoke WebDriver BiDi navigation started with navigable
459    // and a new WebDriver BiDi navigation status whose id is navigationId,
460    // status is "pending", and url is url.
461    // TODO
462    if let Some(sender) = window.webdriver_load_status_sender() {
463        let _ = sender.send(WebDriverLoadStatus::NavigationStart);
464    }
465
466    // Step 18. If navigable's ongoing navigation is "traversal", then:
467    // TODO
468    // Step 19. Set the ongoing navigation for navigable to navigationId.
469    // TODO
470
471    // Step 20. If url's scheme is "javascript", then:
472    if load_data.url.scheme() == "javascript" {
473        // Step 20.1. Queue a global task on the navigation and traversal task source given
474        // navigable's active window to navigate to a javascript: URL given navigable, url,
475        // historyHandling, sourceSnapshotParams, initiatorOriginSnapshot, userInvolvement,
476        // cspNavigationType, initialInsertion, and navigationId.
477
478        let Some(initiator_pipeline_id) = load_data.creator_pipeline_id else {
479            unreachable!("javascript: URL navigations must have a creator pipeline");
480        };
481        let Some(initiator_window) = ScriptThread::find_window(initiator_pipeline_id) else {
482            warn!("Can't find global for navigation initiator");
483            return;
484        };
485
486        let target_window = Trusted::new(window);
487        let mut load_data = load_data;
488        let initiator_window = Trusted::new(&*initiator_window);
489        let task = task!(navigate_javascript: move |cx| {
490            // Important re security. See https://github.com/servo/servo/issues/23373
491            let target_window = target_window.root();
492            let initiator_window = initiator_window.root();
493            if ScriptThread::navigate_to_javascript_url(cx, initiator_window.upcast(), target_window.upcast(), &mut load_data, None, None) {
494                target_window
495                    .as_global_scope()
496                    .script_to_constellation_chan()
497                    .send(ScriptToConstellationMessage::LoadUrl(load_data, history_handling, target_snapshot_params))
498                    .unwrap();
499            }
500        });
501        window
502            .as_global_scope()
503            .task_manager()
504            .navigation_and_traversal_task_source()
505            .queue(task);
506        // Step 20.2. Return.
507        return;
508    }
509
510    // Step 23. In parallel, run these steps:
511    //
512    // TODO: in parallel
513
514    // Step 23.1. Let unloadPromptCanceled be the result of checking if unloading
515    // is canceled for navigable's active document's inclusive descendant navigables.
516    let unload_prompt_canceled = doc.check_if_unloading_is_cancelled(cx, false);
517    // Step 23.2. If unloadPromptCanceled is not "continue",
518    // or navigable's ongoing navigation is no longer navigationId:
519    //
520    // TODO: Check for ongoing navigation
521    if !unload_prompt_canceled {
522        // Step 23.2.1. Invoke WebDriver BiDi navigation failed with navigable
523        // and a new WebDriver BiDi navigation status whose id is navigationId,
524        // status is "canceled", and url is url.
525        // TODO
526        // Step 23.2.2. Abort these steps.
527        return;
528    }
529
530    // Step 23.9. Attempt to populate the history entry's document for historyEntry,
531    // given navigable, "navigate", sourceSnapshotParams, targetSnapshotParams,
532    // userInvolvement, navigationId, navigationParams, cspNavigationType,
533    // with allowPOST set to true and completionSteps set to the following step:
534    window.send_to_constellation(ScriptToConstellationMessage::LoadUrl(
535        load_data,
536        history_handling,
537        target_snapshot_params,
538    ));
539}
540
541/// <https://html.spec.whatwg.org/multipage/#determining-the-creation-sandboxing-flags>
542pub(crate) fn determine_creation_sandboxing_flags(
543    browsing_context: Option<&WindowProxy>,
544    element: Option<&Element>,
545) -> SandboxingFlagSet {
546    // To determine the creation sandboxing flags for a browsing context
547    // browsing context, given null or an element embedder, return the union
548    // of the flags that are present in the following sandboxing flag sets:
549    match element {
550        // If embedder is null, then: the flags set on browsing context's
551        // popup sandboxing flag set.
552        None => browsing_context
553            .and_then(|browsing_context| browsing_context.document())
554            .map(|document| document.active_sandboxing_flag_set())
555            .unwrap_or(SandboxingFlagSet::empty()),
556        Some(element) => {
557            // If embedder is an element, then: the flags set on embedder's
558            // iframe sandboxing flag set.
559            // If embedder is an element, then: the flags set on embedder's
560            // node document's active sandboxing flag set.
561            element
562                .downcast::<HTMLIFrameElement>()
563                .map(|iframe| iframe.sandboxing_flag_set())
564                .unwrap_or(SandboxingFlagSet::empty())
565                .union(element.owner_document().active_sandboxing_flag_set())
566        },
567    }
568}
569
570/// <https://html.spec.whatwg.org/multipage/#determining-the-iframe-element-referrer-policy>
571pub(crate) fn determine_iframe_element_referrer_policy(
572    element: Option<&Element>,
573) -> ReferrerPolicy {
574    // Step 1. If embedder is an iframe element, then return embedder's referrerpolicy
575    // attribute's state's corresponding keyword.
576    element
577        .and_then(|element| element.downcast::<HTMLIFrameElement>())
578        .map(|iframe| {
579            let token = iframe.ReferrerPolicy();
580            ReferrerPolicy::from(&*token.str())
581        })
582        // Step 2. Return the empty string.
583        .unwrap_or(ReferrerPolicy::EmptyString)
584}
585
586/// <https://html.spec.whatwg.org/multipage/#snapshotting-target-snapshot-params>
587pub(crate) fn snapshot_target_snapshot_params(navigable: &WindowProxy) -> TargetSnapshotParams {
588    // TODO(jdm): This doesn't work for cross-origin parent frames.
589    let container = navigable.frame_element();
590    // the result of determining the creation sandboxing flags given targetNavigable's
591    // active browsing context and targetNavigable's container
592    let sandboxing_flags = determine_creation_sandboxing_flags(Some(navigable), container);
593    // the result of determining the iframe element referrer policy given
594    // targetNavigable's container
595    let iframe_element_referrer_policy = determine_iframe_element_referrer_policy(container);
596    TargetSnapshotParams {
597        sandboxing_flags,
598        iframe_element_referrer_policy,
599    }
600}