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

Function isOfficeEnvironment

webapp/_webapp/src/intermediate.ts:55–66  ·  view source on GitHub ↗

* Check if running in Office Add-in environment

()

Source from the content-addressed store, hash-verified

53 * Check if running in Office Add-in environment
54 */
55function isOfficeEnvironment(): boolean {
56 try {
57 return (
58 typeof window !== "undefined" &&
59 "Office" in window &&
60 // eslint-disable-next-line @typescript-eslint/no-explicit-any
61 typeof (window as any).Office?.context !== "undefined"
62 );
63 } catch {
64 return false;
65 }
66}
67
68// Check if we're in ISOLATED world (can access chrome.runtime.sendMessage)
69const isIsolatedWorld = !!getBrowserAPI()?.runtime?.sendMessage;

Callers 1

intermediate.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected