* Open URL in browser - uses system browser in Office, new tab in browser/extension
(url: string)
| 61 | * Open URL in browser - uses system browser in Office, new tab in browser/extension |
| 62 | */ |
| 63 | function openInBrowser(url: string): void { |
| 64 | if (isOfficeEnvironment()) { |
| 65 | // Office Add-in: open in system browser (not Office built-in browser) |
| 66 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 67 | (window as any).Office.context.ui.openBrowserWindow(url); |
| 68 | } else { |
| 69 | // Browser/Extension: open in new tab |
| 70 | const wnd = window.open(url, "_blank"); |
| 71 | if (!wnd) { |
| 72 | throw new Error("failed opening auth window"); |
| 73 | } |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * Get Google OAuth token using browser window and backend polling. |
no test coverage detected