@remix-project/plugin-iframe
v0.3.44
Published
**Except if you want your plugin to ONLY work on the web, prefer [@remix-project/plugin-webview](../webview)**
Downloads
90
Keywords
Readme
Plugin frame
Except if you want your plugin to ONLY work on the web, prefer @remix-project/plugin-webview
This library provides connectors to connect a plugin to an engine running in a web environment.
npm install @remix-project/plugin-iframeIf you do not expose any API you can create an instance like this :
import { createClient } from '@remix-project/plugin-iframe'
const client = createClient()
client.onload(async () => {
const data = client.call('filemanager', 'readFile', 'ballot.sol')
})If you need to expose an API to other plugin you need to extends the class:
import { createClient } from '@remix-project/plugin-iframe'
import { PluginClient } from '@rexmixproject/plugin'
class MyPlugin extends PluginClient {
methods = ['hello']
hello() {
console.log('Hello World')
}
}
const client = createClient()
client.onload(async () => {
const data = client.call('filemanager', 'readFile', 'ballot.sol')
})