FDC3 icon indicating copy to clipboard operation
FDC3 copied to clipboard

"Select Agent" Functionality

Open robmoffat opened this issue 2 months ago • 4 comments

Enhancement Request

When an application is started outside of a desktop agent environment, it will not connect to a DA.
In cases like this, the FDC3 connectivity won't work.

One option is that we open a popup requesting a URL for the desktop agent. So, the flow might be:

  1. I have a Web Desktop Agent running in Tab 1
  2. I (or something else) opens up an application that needs to connect to FDC3 in Tab 2.
  3. Tab 2 wasn't opened / connected to Tab 1.
  4. Tab 2 doesn't find the DA, but, having tried everything else pops up a window asking for a URL.
  5. In the Web Desktop Agent, you go to a config screen and press a button to get a personalised URL for App2.
  6. You paste the URL into Tab 2 and they handshake over DACP and work together.

robmoffat avatar Oct 15 '25 15:10 robmoffat

@seewhatson

robmoffat avatar Oct 15 '25 15:10 robmoffat

We talked through this case some when developing FDC3 for Web, resulting in the failover function parameter to getAgent(). That function is called when a desktop agent hasn't been found at window.fdc3 or via a parent window or frame:

 * @property {function} failover An optional function that provides a
 * means of connecting to or starting a Desktop Agent, which will be called
 * if no Desktop Agent is detected. Must return either a Desktop Agent
 * implementation directly (e.g. by using a proprietary adaptor) or a
 * WindowProxy (e.g a reference to another window returned by `window.open`
 * or an iframe's `contentWindow`) for a window or frame in which it has loaded
 * a Desktop Agent or suitable proxy to one that works with FDC3 Web Connection
 * and Desktop Agent Communication Protocols.

...

type GetAgentParams = { 
    timeoutMs?: number, 
    identityUrl?: string, 
    channelSelector?: boolean, 
    intentResolver?: boolean,
    dontSetWindowFdc3?: boolean,
    failover?: (args: GetAgentParams) => Promise<WindowProxy | DesktopAgent>,
    logLevels?: GetAgentLogLevels;
};

The function has to return either a WindowProxy (pointing to a window or frame where the DA is running) are something that implements the DesktopAgent interface, getAgent will handle that (connecting to the windowProxy and turning that into a DesktopAgentProxy if it needs to) and then return the DA reference to the original caller.

Hence, there's a nice place to plugin in whatever you figure out there.

kriswest avatar Oct 15 '25 15:10 kriswest

Hence, there's a nice place to plugin in whatever you figure out there.

Yes. Although I* think what I'm suggesting is something that happens after the failover has been tried and, er, failed.

*I am at the hackathon with @patrocinio et al

robmoffat avatar Oct 15 '25 18:10 robmoffat

Yes. Although I* think what I'm suggesting is something that happens after the failover has been tried and, er, failed.

Sounds to me like the very definition of the purpose of the failover. The idea is to give an app somewhere to plug in something to do if a da is not found. If they passed whatever it is you're talking about doing as their failover they can opt into that 'discovery' process?

kriswest avatar Oct 15 '25 18:10 kriswest