@@ -52,8 +52,6 @@ export const enum Phase {
5252 CLOCK_SYNC = 'c' ,
5353}
5454
55- export type NonEmptyString = string & { _tag : 'NonEmptyString' } ;
56-
5755export function isNestableAsyncPhase ( phase : Phase ) : boolean {
5856 return phase === Phase . ASYNC_NESTABLE_START || phase === Phase . ASYNC_NESTABLE_END ||
5957 phase === Phase . ASYNC_NESTABLE_INSTANT ;
@@ -596,43 +594,29 @@ export interface Mark extends Event {
596594 ph : Phase . MARK ;
597595}
598596
599- // An unreliable and non-legit navigationStart. See NavigationStartWithUrl
600- export interface NavigationStartUnreliable extends Mark {
597+ export interface NavigationStart extends Mark {
601598 name : 'navigationStart' ;
602599 args : Args & {
603- data ?: ArgsData & {
604- /** An empty documentLoaderURL means this navigationStart is unreliable noise and can be ignored. */
605- documentLoaderURL : never ,
600+ frame : string ,
601+ data ?: ArgsData & {
602+ /** Must be non-empty to be valid. An empty documentLoaderURL means the event can be ignored. */
603+ documentLoaderURL : string ,
606604 isLoadingMainFrame : boolean ,
607- // isOutermostMainFrame was introduced in crrev.com/c/3625434 and exists
608- // because of Fenced Frames
609- // [github.com/WICG/fenced-frame/tree/master/explainer].
610- // Fenced frames introduce a situation where isLoadingMainFrame could be
611- // true for a navigation, but that navigation be within an embedded "main
612- // frame", and therefore it wouldn't be on the top level main frame.
613- // In situations where we need to distinguish that, we can rely on
614- // isOutermostMainFrame, which will only be true for navigations on the
615- // top level main frame.
616-
617- // This flag is optional as it was introduced in May 2022; so users
618- // reasonably may import traces from before that date that do not have
619- // this field present.
620- isOutermostMainFrame ?: boolean , navigationId : string ,
605+ navigationId : string ,
606+ /**
607+ * `isOutermostMainFrame` was introduced in crrev.com/c/3625434 and exists because of Fenced Frames
608+ * [github.com/WICG/fenced-frame/tree/master/explainer]. Fenced frames introduce a situation where
609+ * `isLoadingMainFrame` could be true for a navigation, but that navigation be within an embedded "main frame", and
610+ * therefore it wouldn't be on the top level main frame. In situations where we need to distinguish that, we can
611+ * rely on `isOutermostMainFrame`, which will only be true for navigations on the top level main frame.
612+ * This flag is optional as it was introduced in May 2022; so users reasonably may import traces from before that
613+ * date that do not have this field present.
614+ */
615+ isOutermostMainFrame ?: boolean ,
621616 /**
622617 * @deprecated use documentLoaderURL for navigation events URLs
623618 */
624619 url ?: string ,
625- } ,
626- frame : string ,
627- } ;
628- }
629-
630- // NavigationStart but definitely has a populated documentLoaderURL
631- export interface NavigationStart extends NavigationStartUnreliable {
632- args : NavigationStartUnreliable [ 'args' ] & {
633- data : NavigationStartUnreliable [ 'args' ] [ 'data' ] & {
634- /** This navigationStart is valid, as the documentLoaderURL isn't empty. */
635- documentLoaderURL : NonEmptyString ,
636620 } ,
637621 } ;
638622}
@@ -2050,13 +2034,6 @@ export function isCommitLoad(
20502034 return event . name === 'CommitLoad' ;
20512035}
20522036
2053- /** @deprecated You probably want `isNavigationStart` instead. */
2054- export function isNavigationStartUnreliable (
2055- event : Event ,
2056- ) : event is NavigationStartUnreliable {
2057- return event . name === 'navigationStart' ;
2058- }
2059-
20602037export function isAnimation (
20612038 event : Event ,
20622039 ) : event is Animation {
@@ -2210,7 +2187,7 @@ export function isPrePaint(
22102187
22112188/** A VALID navigation start (as it has a populated documentLoaderURL) */
22122189export function isNavigationStart ( event : Event ) : event is NavigationStart {
2213- return Boolean ( isNavigationStartUnreliable ( event ) && event . args . data && event . args . data . documentLoaderURL !== '' ) ;
2190+ return event . name === 'navigationStart' && ( event as NavigationStart ) . args ? .data ? .documentLoaderURL !== '' ;
22142191}
22152192
22162193export function isMainFrameViewport (
0 commit comments