
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
Library for rendering cross-domain components and communication between them
npm:
npm install iframy --save
yarn:
yarn add iframy
![]() Internet Explorer | ![]() Microsoft Edge | ![]() ![]() Mozilla Firefox | ![]() ![]() ![]() Google Chrome | ![]() ![]() Opera | ![]() ![]() ![]() Safari | ![]() Android WebView |
|---|---|---|---|---|---|---|
| 10+ * | 12+ | 8+ | 1+ | 9.5+ | 4+ | Yes |
* - Only for inline mode
Use method to initiate instance and pass necessary props / iframe configuration
dimensions - object with width and height properties, applied to iframe
props - any serializable initial data to send to child
scrolling - param to highlight whether content inside iframe should be scrollable
url - url to open inside child iframe
import { IFramyParent } from 'iframy/parent';
const iframy = IFramyParent.create({
dimensions: {
width: '80%',
height: '80%',
},
props: {
name: 'Alex',
},
scrolling: true,
url: 'https://web-site.com',
});
Async method to render iframe into specific container. Used for lazy rendering of component. Once promise is resolved - child component is ready to be used
selector - string / HTMLElement parameter to point container where to render iframe
import { IFramyParent } from 'iframy/parent';
const iframy = IFramyParent.create({
dimensions: {
width: '80%',
height: '80%',
},
props: {
name: 'Alex',
},
scrolling: true,
url: 'https://web-site.com',
});
await iframy.render('#container');
Method to send message to child component
iframy.emit('message-type', { any: 'data' });
Method to subscribe to events, being sent from child
iframy.addListener('message-type', data => console.log(data));
// or use alias
iframy.on('message-type', data => console.log(data));
Method to subscribe to events, being sent from child; emitted once and listener is removed after that
iframy.addListenerOnce('message-type', data => console.log(data));
// or use alias
iframy.once('message-type', data => console.log(data));
Method to remove specific listener from correspondent event type from child
iframy.removeListener('message-type', listener);
// or use alias
iframy.off('message-type', listener);
Method to remove all listeners from correspondent event type from child
iframy.removeAllListeners('message-type');
// or use alias
iframy.offAll('message-type');
Use method to initialize child component and let parent know, that your iframe is ready
api - object of { [key: string]: function } structure to initialize api, being used by parent
import { IFramyChild } from 'iframy/child';
const iframy = await IFramyChild.create({
api: {
sendMessage: data => {;
return `Message: ${data}`;
},
},
});
Data, passed from parent. Useful to receive initial data from parent window
const data = iframy.props;
Method to send message to parent component
iframy.emit('message-type', { any: 'data' });
Method to subscribe to events, being sent from parent
iframy.addListener('message-type', data => console.log(data));
// or use alias
iframy.on('message-type', data => console.log(data));
Method to subscribe to events, being sent from parent; emitted once and listener is removed after that
iframy.addListenerOnce('message-type', data => console.log(data));
// or use alias
iframy.once('message-type', data => console.log(data));
Method to remove specific listener from correspondent event type from parent
iframy.removeListener('message-type', listener);
// or use alias
iframy.off('message-type', listener);
Method to remove all listeners from correspondent event type from parent
iframy.removeAllListeners('message-type');
// or use alias
iframy.offAll('message-type');
Find example here
iframy is open-source library, opened for contributions
in progress
iframy is MIT licensed
FAQs
Library for creating & controlling cross-domain components
We found that iframy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.