Skip to content

Commit

Permalink
Updated Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
robmoffat committed Aug 24, 2023
1 parent 88b03cf commit 94f76f4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,20 @@ This is a minimal proof-of-concept for FDC3 For the Web.
- In `\lib`: A minimal implementation of web api retrieval. This relies on the `post-message` strategy for communicating between apps and the desktop agent. This supports two functions:
- `supply` (in `supply.ts`): Called by the desktop agent on startup, allows it to supply FDC3 APIs to apps when they ask for one. This takes the following parameters:
- A `url` of a piece of javascript that the App will load in order to initialise it's API.
- A `checker`, which checks the origin window for the API request. It should be a window that the Desktop Agent is aware of.
- A `detailsResolver`, which returns a map of properties to send to the API requestor that should be used to instantiate the API.
- **For the App**: `load` (in `load.ts`): Called (with options) by an FDC3 Aoo to retrieve the API. This retrieves `details` from the desktop agent and initialises a `DesktopAgent` API implementation, returning it in a promise. There are various options available:
- _strategies_: This allows plugable strategies for getting the DA. Two exist:
- `electron-event` which waits for `window.fdc3` to be set and
- `post-message` which fires a post message up to the opening window/iframe (or whatever is set in the `frame` option) asking for details of how to construct a `DesktopAgent` API implementation.
- _methods_: The app can also suggest methods ways in which it might want to construct the `DesktopAgent` API. The desktop agent is obliged to try and return a response back to the app detailing one of the approaches that the app asks for. Two exist so far:
- `js-inject` : The desktop agent responds with a URL of some javascript, loaded by the app to create a `DesktopAgent` API. (See App2 which does this)
- `post-message-protocol` : The app expects to communicate with the desktop agent via standard [Desktop-Agent-Bridging](https://fdc3.finos.org/docs/next/agent-bridging/spec) messages, sent and received via post-message.
- `load` (in `load.ts`): Called (with options) by an FDC3 Aoo to retrieve the API. This retrieves the `url` and `details` from the desktop agent and initialises a `DesktopAgent` implementation, returning it in a promise.
- **For the desktop agent**: `supply` (in `agent/supply.ts`): Called by the desktop agent on startup, allows it to supply FDC3 APIs to apps when they ask for one via the `post-message` strategy. This takes the following parameters:
- A `checker`, which checks the origin window for the API request. It should be a window that the Desktop Agent is aware of.
- A map of `detailsResolver`s, which returns a map of properties to send to the API requestor (the app) that should be used to instantiate the API. This map is keyed by the names of the _methods_ above.
- In `\demo`: A fixture for demonstrating the above, containing two apps, `app1` and `app2` and a rudimentary `dummy-desktop-agent` all of which use the `webc3.ts` library.
Expand All @@ -39,14 +47,13 @@ This is a minimal proof-of-concept for FDC3 For the Web.
- Since this uses Vite, you can modify the code and see it running the browser immediately.
- This currently only supports FDC3 2.0
- This supports cross-origin, (at least on my machine!) you can configure hostnames in `dummy-desktop-agent.ts` to try this out.
- Also supports the difference between frames and tabs.
## TO DO
- Figure out options, setting global
- Fallback strategy in case FDC3 API isn't available (currently promise never resolves)
- Sanitisation of response from the Desktop Agent
- Handing of fdc3Ready
- Handling of Electron container injection approach
Empty file.

0 comments on commit 94f76f4

Please sign in to comment.