Socket
Socket
Sign inDemoInstall

iframe-rpc-util

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iframe-rpc-util - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

dist/iframe-rpc.js

2

package.json
{
"name": "iframe-rpc-util",
"version": "1.0.0",
"version": "1.0.1",
"description": "RPC between cross-origin iframe using postMessage",

@@ -5,0 +5,0 @@ "type": "module",

@@ -32,9 +32,9 @@ # iframe-rpc-util

// register function
iframeProxy.parentFunc = (data) => {
// return remote data
return 'parent function'
}
// iframe init event
iframeProxy.onInit = (data) => {
// get rpc register function
iframeProxy.getKeys().then((data) => {
console.log('parent getKeys', data)
})
window.onload = () => {
// call children function

@@ -45,6 +45,12 @@ iframeProxy.childrenFunc('parent params').then((data) => {

}
// register function
iframeProxy.parentFunc = (data) => {
// return remote data
return 'parent function'
}
```
### children Iframe
### Children Iframe

@@ -51,0 +57,0 @@ ```js

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc