iframe-rpc-util
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
6679
5
69
73
0