From 0a3d334aa8a7e765f4abba23a464b5ca0f0c1ac5 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sun, 9 Jun 2024 00:37:55 +0530 Subject: [PATCH] feat: get current url of active RB --- server/src/routes/record.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/server/src/routes/record.ts b/server/src/routes/record.ts index 79ce2f73..0c27ceec 100644 --- a/server/src/routes/record.ts +++ b/server/src/routes/record.ts @@ -66,3 +66,16 @@ router.get('/active', (req, res) => { const id = getActiveBrowserId(); return res.send(id); }); + +/** + * GET endpoint for getting the current url of the active remote browser. + */ +router.get('/active/url', (req, res) => { + const id = getActiveBrowserId(); + if (id) { + const url = getRemoteBrowserCurrentUrl(id); + return res.send(url); + } + return res.send(null); +}); +