Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
@byhealth/channel
Advanced tools
Quickly connect to iframe.
Install package npm install @byhealth/channel
import { Host } from '@byhealth/channel';
const host = new Host({
allowedOrigins: ['http://*.example.com'],
target: '#container',
});
host.on('ready', function () {
console.log('Host: client ready');
});
host.on('error', function (error) {
console.error(error);
});
host.open('./iframe.html', {
style: 'border: 0',
width: '100%',
height: '100px',
});
import { Client } from '@byhealth/channel';
const client = new Client({
allowedOrigins: ['http://*.example.com'],
});
client.on('ready', function () {
console.log('Client: Host ready');
});
client.on('error', function (error) {
console.error(error);
});
client.connect();
interface HostConfig {
/**
* Example: ['https://*.by-health.com', 'https://*.4000916916.com']
*/
allowedOrigins?: string[];
/**
* Mount point as selector or target element.
*/
target?: string | HTMLElement;
/**
* Auto adjust height when receive 'resize' event from client
*/
autoHeight?: boolean;
}
host.open(url: string, attr?: any): void
Open iframe.
url
: iframe open urlattrs
: iframe attributes, eg: width, height, style, class...host.close(): void
Close (remove) iframe.
host.on(event: string, fn: (...args: any[]) => void, context?: any): void
Add an event listener.
event
: event namefn
: event callbackcontext
: callback context (this)host.once(event: string, fn: (...args: any[]) => void, context?: any): void
Add an event listener, the same as host.on()
, but the callback is automatically deleted after the call.
event
: event namefn
: event callbackcontext
: callback context (this)host.off(event: string, fn: (...args: any[]) => void, context?: any): void
Remove an event listener.
event
: event namefn
: event callbackcontext
: callback context (this)host.emit(event: string, data?: any): void
Dispatch event
, the client will receive it.
event
: event namedata
: payloadinterface ClientConfig {
/**
* Example: ['https://*.by-health.com', 'https://*.4000916916.com']
*/
allowedOrigins?: string[];
/**
* Add window.addEventListener('resize') listener, when the height of the element changes, it automatically emit `resize` event to the host
*/
autoHeight?: boolean;
}
client.connect(): void
Connect to host.
client.disconnect(): void
Disconnect to host.
client.on(event: string, fn: (...args: any[]) => void, context?: any): void
Add an event listener.
event
: event namefn
: event callbackcontext
: callback context (this)client.once(event: string, fn: (...args: any[]) => void, context?: any): void
Add an event listener, the same as client.on()
, but the callback is automatically deleted after the call.
event
: event namefn
: event callbackcontext
: callback context (this)client.off(event: string, fn: (...args: any[]) => void, context?: any): void
Remove an event listener.
event
: event namefn
: event callbackcontext
: callback context (this)client.emit(event: string, data?: any): void
Dispatch event
, the host will receive it.
event
: event namedata
: payloadFAQs
Quickly connect to iframe.
The npm package @byhealth/channel receives a total of 5 weekly downloads. As such, @byhealth/channel popularity was classified as not popular.
We found that @byhealth/channel demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.