Currere
An easy way to publish an api to communicate with iFrames.
Example
parent
const api = { console; } version: '0.0.1'; ;
iFrame
const api = { console; return 46; }; ;
this would produce the following in your console
version 0.0.1 bar called with: nachosfoo called with: cheeseand returned: 46and returned: undefined
Caveats
All api methods must return a "JSON serializable" value. (i.e. no functions)
Why "Currere"?
"Currere" is a latin word meaning "to run". It is also the word that "courier" (meaning messenger) is derived from. Both "run" (as in run a function) and "messenger" (as in postMessage api) seemed relevant to this project.