@@ -91,37 +91,19 @@ document.addEventListener('visibilitychange', () => {
9191 Host . rnPerfMetrics . browserVisibilityChanged ( document . visibilityState ) ;
9292} ) ;
9393
94- class FuseboxClientMetadataModel extends SDK . SDKModel . SDKModel < void > {
95- constructor ( target : SDK . Target . Target ) {
96- super ( target ) ;
97- Host . rnPerfMetrics . fuseboxSetClientMetadataStarted ( ) ;
98- target . fuseboxClientAgent ( )
99- . invoke_setClientMetadata ( )
100- . then ( result => {
101- const maybeError = result . getError ( ) ;
102- const success = ! maybeError ;
103- Host . rnPerfMetrics . fuseboxSetClientMetadataFinished ( success , maybeError ) ;
104- } )
105- . catch ( reason => {
106- const success = false ;
107- Host . rnPerfMetrics . fuseboxSetClientMetadataFinished ( success , reason ) ;
108- } ) ;
109- }
110- }
111-
11294SDK . SDKModel . SDKModel . register (
113- FuseboxClientMetadataModel ,
114- {
115- capabilities : SDK . Target . Capability . None ,
116- autostart : true ,
117- // Ensure FuseboxClient.setClientMetadata is sent before most other CDP domains
118- // are initialised. This allows the backend to confidently detect non-Fusebox
119- // clients by the fact that they send e.g. Runtime.enable without sending any
120- // Fusebox-specific messages first.
121- // TODO: Explicitly depend on this model in RuntimeModel and LogModel, and
122- // remove the `early` and `autostart` flags.
123- early : true ,
124- } ,
95+ SDK . FuseboxClientMetadataModel . FuseboxClientMetadataModel ,
96+ {
97+ capabilities : SDK . Target . Capability . None ,
98+ autostart : true ,
99+ // Ensure FuseboxClient.setClientMetadata is sent before most other CDP domains
100+ // are initialised. This allows the backend to confidently detect non-Fusebox
101+ // clients by the fact that they send e.g. Runtime.enable without sending any
102+ // Fusebox-specific messages first.
103+ // TODO: Explicitly depend on this model in RuntimeModel and LogModel, and
104+ // remove the `early` and `autostart` flags.
105+ early : true ,
106+ } ,
125107) ;
126108
127109let loadedSourcesModule : ( typeof Sources | undefined ) ;
0 commit comments