package
Web Request RPC
npm install web-request-rpcGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Estimated unpacked size across 1 packages.
41.7 kB
Includes dependencies.
JSON-RPC for Web Request Polyfills
The RPC protocol used in this library relies on the use of postMessage
and JSON-RPC. While it could potentially be made more general, it is
currently targeted at building components that help implement "Web Request"
polyfills.
A "Web request" is a catch all for a request made from a Web application (the relying party) that is fulfilled by another Web application (the service provider) that is typically from another origin. There are a number of different "Web requests" such as requests for payment, credentials, social information, or media. Each of these may have a Web API that is narrowly targeted (or includes specific features related to) at the specific type of request, however, each of them follow the same general model. This means some building blocks for creating polyfills for these sorts of "Web requests" can be shared.
Some of these building blocks are provided by this library.
A Client is used to connect to an RPC Server.
TODO
TODO:
A WebAppContext loads or attaches to a window with a remote Web Application that typically runs on a cross domain website. It is used to manage and provide access this RPC WebApp. It also enables the WebApp to make some control calls, such as to show or hide its UI.
Use cases include:
TODO: Add note about usefulness of passing a Promise for a window handle
when creating/connecting with client/server/WebAppContext/etc. This approach
enables a message listener to be attached prior to the creation of the
window where access to the window handle is not available until the window
has loaded. This is important to prevent missing messages.
A Web Application that uses RPC to communicate with a WebAppContext that is loaded by another, typically cross domain, website. This Web Application could be a "Web Request Mediator" that will itself load WebApps, or an application designed to fulfill Web requests.
msporny
msporny@digitalbazaar.com