File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
packages/playwright-core/src/web/traceViewer Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -29,5 +29,7 @@ import '../common.css';
29
29
navigator . serviceWorker . oncontrollerchange = ( ) => f ( ) ;
30
30
} ) ;
31
31
}
32
+ // Keep SW running.
33
+ setInterval ( function ( ) { fetch ( 'ping' ) ; } , 10000 ) ;
32
34
ReactDOM . render ( < Workbench /> , document . querySelector ( '#root' ) ) ;
33
35
} ) ( ) ;
Original file line number Diff line number Diff line change @@ -56,8 +56,12 @@ async function doFetch(event: FetchEvent): Promise<Response> {
56
56
const url = new URL ( request . url ) ;
57
57
58
58
const relativePath = url . pathname . substring ( scopePath . length - 1 ) ;
59
- if ( relativePath === '/context ' ) {
59
+ if ( relativePath === '/ping ' ) {
60
60
await gc ( ) ;
61
+ return new Response ( null , { status : 200 } ) ;
62
+ }
63
+
64
+ if ( relativePath === '/context' ) {
61
65
const traceModel = await loadTrace ( traceUrl , event . clientId ) ;
62
66
return new Response ( JSON . stringify ( traceModel ! . contextEntry ) , {
63
67
status : 200 ,
You can’t perform that action at this time.
0 commit comments