
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A TypeScript library for IPC communication in web applications and browser extensions
A TypeScript library for IPC (Inter-Process Communication) between different contexts (e.g. chrome extension's content.js and background.js) in web. It provides a native-like calling experience between different contexts.
npm install web-ipc
export interface BackgroundNotificationInterface {
// must return a Promise
notify(title: string, message: string): Promise<string>
}
class BackgroundNotification implements BackgroundNotificationInterface {
async notify(title: string, message: string): Promise<string> {
let notificationId = `notification-${Date.now()}`;
chrome.notifications.create(notificationId, {
type: 'basic',
title: title,
message: message
});
return notificationId;
}
}
import {chromeRuntimeMessageIpcProviderRegister} from "web-ipc";
chromeRuntimeMessageIpcProviderRegister("BackgroundNotificationInterface", new BackgroundNotification())
import {chromeRuntimeIpcInvoker} from "web-ipc";
const backgroundNotification = chromeRuntimeIpcInvoker.createProxy<BackgroundNotificationInterface>("BackgroundNotificationInterface")
let notificationId = await backgroundNotification.notify("hello", "this is a notification from content script")
console.log(notificationId)
chrome.runtime for communicationFor communication via window.postMessage, use windowMessageIpcProviderRegister and windowMessageIpcInvoker.
$rawInfosYou can access the raw communication information (such as sender info in Chrome extensions) by adding a parameter named $rawInfos to your method. This parameter will be automatically injected with the underlying communication details.
export interface BackgroundNotificationInterface {
notify(title: string, message: string, $rawInfos?: any): Promise<string>
}
class BackgroundNotification implements BackgroundNotificationInterface {
async notify(title: string, message: string, $rawInfos?: any): Promise<string> {
// For chrome.runtime, $rawInfos contains the sender object
console.log('Sender tab ID:', $rawInfos?.sender?.tab?.id);
console.log('Sender URL:', $rawInfos?.sender?.url);
let notificationId = `notification-${Date.now()}`;
chrome.notifications.create(notificationId, {
type: 'basic',
title: title,
message: message
});
return notificationId;
}
}
Note: The $rawInfos parameter is optional and will be automatically injected by the framework. You don't need to pass it when calling the method from the client side.
MIT
FAQs
A TypeScript library for IPC communication in web applications and browser extensions
We found that web-ipc demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.