firefox-devtools / bidi-har-export

Experimental module to compile WebDriver BiDi network events as a HAR file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove startRecording for HarRecorder

juliandescottes opened this issue · comments

The base HarRecorder doesn't need to subscribe to events (as it should be done by the consumer). So the call to startRecording is only there to reset the state before we record event.

Meaning we could make startRecording optional, and the first call to recordEvent could take care of resetting the state when needed. Or we can completely remove startRecording. This would leave us with only two public methods on this recorder: recordEvent and stopRecording.

Maybe we should just remove any notion of state from this class and just have two methods: recordEvent and exportAsHar, and then consumers would just create a new recorder for each record they want to build?