diff --git a/src/extension/plugins.md b/src/extension/plugins.md index 6b907f1..787abf8 100644 --- a/src/extension/plugins.md +++ b/src/extension/plugins.md @@ -25,16 +25,18 @@ A plugin must include a configuration JSON file that describes its behavior and ```ts export type PluginConfig = { - title: string; // The name of the plugin - description: string; // A description of the plugin's purpose - icon?: string; // A base64-encoded image string representing the plugin's icon (optional) - steps?: StepConfig[]; // An array describing the UI steps and behavior (see Step UI below) (optional) - hostFunctions?: string[];// Host functions that the plugin will have access to - cookies?: string[]; // Cookies the plugin will have access to, cached by the extension from specified hosts (optional) - headers?: string[]; // Headers the plugin will have access to, cached by the extension from specified hosts (optional) + title: string; // The name of the plugin + description: string; // A description of the plugin purpose + icon?: string; // A base64-encoded image string representing the plugin's icon (optional) + steps?: StepConfig[]; // An array describing the UI steps and behavior (see Step UI below) (optional) + hostFunctions?: string[]; // Host functions that the plugin will have access to + cookies?: string[]; // Cookies the plugin will have access to, cached by the extension from specified hosts (optional) + headers?: string[]; // Headers the plugin will have access to, cached by the extension from specified hosts (optional) + localStorage?: string[]; // LocalStorage the plugin will have access to, cached by the extension from specified hosts (optional) + sessionStorage?: string[]; // SessionStorage the plugin will have access to, cached by the extension from specified hosts (optional) requests: { method: string; url: string }[]; // List of requests that the plugin is allowed to make - notaryUrls?: string[]; // List of notary services that the plugin is allowed to use (optional) - proxyUrls?: string[]; // List of websocket proxies that the plugin is allowed to use (optional) + notaryUrls?: string[]; // List of notary services that the plugin is allowed to use (optional) + proxyUrls?: string[]; // List of websocket proxies that the plugin is allowed to use (optional) }; ``` @@ -118,4 +120,4 @@ function parseResponse() { ]; Host.outputString(JSON.stringify(secretResps)); } -``` \ No newline at end of file +``` diff --git a/src/extension/provider.md b/src/extension/provider.md index 7664305..15b7ede 100644 --- a/src/extension/provider.md +++ b/src/extension/provider.md @@ -175,6 +175,8 @@ type PluginConfig = { hostFunctions?: string[]; cookies?: string[]; headers?: string[]; + localStorage?: string[]; + sessionStorage?: string[]; requests: { method: string; url: string }[]; notaryUrls?: string[]; proxyUrls?: string[]; @@ -189,12 +191,13 @@ const plugin = await client.getPlugins('**', 'https://swapi.dev', {id: 'demo-plu #### Screenshot ![Screenshot 2024-07-04 at 3 23 14 PM](./images/share_installed_plugins.png) -### `client.runPlugin(id)` +### `client.runPlugin(id, params)` This method is used to request the execution of a plugin. #### Parameters 1. `id`: The ID of the plugin. +2. `params` *(optional)*: An object containing user input parameters as key-value pairs. #### Returns A promise that resolves to the proof data. @@ -208,8 +211,11 @@ type ProofData = { #### Example ```ts -const plugin = await client.runPlugin("6931d2ad63340d3a1fb1a5c1e3f4454c5a518164d6de5ad272e744832355ee02"); +const plugin = await client.runPlugin( + "6931d2ad63340d3a1fb1a5c1e3f4454c5a518164d6de5ad272e744832355ee02", + { Key: "Value" } +); ``` #### Screenshot -![Screenshot 2024-07-04 at 3 24 09 PM](./images/execute_plugin.png) \ No newline at end of file +![Screenshot 2024-07-04 at 3 24 09 PM](./images/execute_plugin.png)