bunch of refactor and styling changes, coming along nicely

This commit is contained in:
Sriram Hariharan
2023-03-07 01:42:26 -06:00
parent f48f39e67b
commit 04a82fb6a6
16 changed files with 225 additions and 63 deletions

View File

@@ -0,0 +1,10 @@
/**
* This is a helper function that opens a new tab in the current window, and focuses the window
* @param tabIndex - the index of the tab to open the new tab at (optional)
* @returns the tab that was opened
*/
export default async function openNewTab(url: string, tabIndex?: number): Promise<chrome.tabs.Tab> {
const tab = await chrome.tabs.create({ url, index: tabIndex, active: true });
await chrome.windows.update(tab.windowId, { focused: true });
return tab;
}