import { mockRequests } from "../mocks/mock-requests" ; let removeListeners = { } ; export const mockChrome = { devtools : { panels : { themeName : "dark" , } , network : { getHAR : ( cb ) => { cb ( { entries : mockRequests } as any ) ; } , onRequestFinished : { addListener : ( cb ) => { const handleKeydown = ( e ) => { if ( e . code === "Digit1" ) { mockRequests . forEach ( ( mockRequest ) => { cb ( mockRequest as any ) ; } ) ; } } ; window . addEventListener ( "keydown" , handleKeydown ) ; removeListeners . onRequestFinished = ( ) => window . removeEventListener ( "keydown" , handleKeydown ) ; } , removeListener : ( cb ) => { removeListeners . onRequestFinished ( ) ; } , } , onNavigated : { addListener : ( cb ) => { } , removeListener : ( cb ) => { } , } , } , } , } as typeof chrome ;