MCPcopy Create free account
hub / github.com/PaperDebugger/paperdebugger / openInBrowser

Function openInBrowser

webapp/_webapp/src/libs/oauth.ts:63–75  ·  view source on GitHub ↗

* Open URL in browser - uses system browser in Office, new tab in browser/extension

(url: string)

Source from the content-addressed store, hash-verified

61 * Open URL in browser - uses system browser in Office, new tab in browser/extension
62 */
63function 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.

Callers 2

getGoogleAuthTokenFunction · 0.85
getAppleAuthTokenFunction · 0.85

Calls 1

isOfficeEnvironmentFunction · 0.70

Tested by

no test coverage detected