feat: get active browser id

This commit is contained in:
karishmas6
2024-06-09 01:06:38 +05:30
parent 7018e7dde0
commit 7b4d213a06

View File

@@ -24,3 +24,16 @@ export const stopRecording = async (id: string): Promise<void> => {
});
};
export const getActiveBrowserId = async(): Promise<string> => {
try {
const response = await axios.get('http://localhost:8080/record/active');
if (response.status === 200) {
return response.data;
} else {
throw new Error('Couldn\'t get active browser');
}
} catch(error: any) {
return '';
}
};