From 38024195286cde5e70f439dd997cad52870bdcae Mon Sep 17 00:00:00 2001 From: Dmitry Zlygin Date: Mon, 8 Nov 2021 15:28:40 +0300 Subject: [PATCH] support for "Speed up the process of joining meetings (Beta)" --- commands.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/commands.js b/commands.js index 7c9c1e2..d669576 100644 --- a/commands.js +++ b/commands.js @@ -1,10 +1,15 @@ async function getRcvTab() { - const tabs = await chrome.tabs.query({ status: 'complete', title: 'RingCentral Video' }); + const tabs = await chrome.tabs.query({ status: 'complete' }); + const filteredTabs = tabs.filter(tab => tab.title.startsWith('RingCentral Video')); - if (tabs.length > 0) { - const inMeetingTab = tabs.find(tab => tab.url.includes('/conf/on/')); + if (filteredTabs.length > 0) { + const inMeetingTab = filteredTabs.find( + tab => tab.title.startsWith('RingCentral Video:') + ? tab.url === 'about:blank' + : tab.url.includes('/conf/on/') + ); - return inMeetingTab ?? tabs[0]; + return inMeetingTab ?? filteredTabs[0]; } else { return null; }