From 7b4d213a062955ba4dfbd353aafe26e4373f5685 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sun, 9 Jun 2024 01:06:38 +0530 Subject: [PATCH] feat: get active browser id --- src/api/recording.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/api/recording.ts b/src/api/recording.ts index b8247b53..89ae4dfe 100644 --- a/src/api/recording.ts +++ b/src/api/recording.ts @@ -24,3 +24,16 @@ export const stopRecording = async (id: string): Promise => { }); }; +export const getActiveBrowserId = async(): Promise => { + 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 ''; + } +}; +