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

Function isOfficeEnvironment

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

* Check if running in Office Add-in environment

()

Source from the content-addressed store, hash-verified

45 * Check if running in Office Add-in environment
46 */
47function isOfficeEnvironment(): boolean {
48 try {
49 return (
50 typeof window !== "undefined" &&
51 "Office" in window &&
52 // eslint-disable-next-line @typescript-eslint/no-explicit-any
53 typeof (window as any).Office?.context?.ui?.openBrowserWindow === "function"
54 );
55 } catch {
56 return false;
57 }
58}
59
60/**
61 * Open URL in browser - uses system browser in Office, new tab in browser/extension

Callers 1

openInBrowserFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected