Probe helpers

window.osClient is a host proxy, and reading an unknown member behaves differently across client versions: some versions throw (0x80020006, e.g. v11.10.718 / v12.0.702), others silently return undefined (e.g. v10.10.716). Both outcomes must be treated as "not present" — which is why the probes combine a try/catch and a typeof check (a bare typeof throws on the newer clients; a bare try/catch alone misses the type check on the older ones).

The bridge itself may be callable: the WebView2 rich client (measured on 12.0.713) injects a host-object proxy around a function, so typeof window.osClient is 'function'. The probes accept an object bridge and a callable bridge alike; every other value (null, undefined, primitives) counts as "no bridge".

1. Functions

Function Behavior

probeFunction(bridge, name)

true when bridge[name] is a function; false for absent, undefined or throwing reads (and for a bridge that is neither an object nor callable).

probeRead(bridge, name)

Reads bridge[name], returning undefined for absent or throwing reads.

isFullDashletBridge(bridge)

true when the bridge is a full dashlet bridge — the marker member is osjxGetSelectedObjects. The reduced COM-OpenBrowser bridge (which carries only osjxGetBrowserEnvironment + osjxSetBrowserCaption) reports false.

The library uses isFullDashletBridge to gate which bridge capabilities it exposes; a reduced bridge still self-initializes, but the selection and method capabilities that need the full bridge are unavailable. Only probeFunction and isFullDashletBridge are re-exported from the package root; probeRead is an internal helper.