Socket
Book a DemoInstallSign in
Socket

@musubi/browser-extension-link

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@musubi/browser-extension-link

Musubi 🪢 End-to-end typesafe communication. 🎉

latest
npmnpm
Version
0.12.0
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

Musubi 🪢

End-to-end typesafe communication. 🎉

Adapter for using Musubi in browser extension.

Documentation

Full documentation for musubi can be found here.

Installation

# npm
npm install @musubi/browser-extension-link

# Yarn
yarn add @musubi/browser-extension-link

Usage

// Background/service worker script
import { createBrowserExtensionLink } from '@musubi/browser-extension-link';
import { MusubiReceiver } from '@musubi/core';
import { schema } from '../schema';
import * as browser from 'webextension-polyfill';

async function main() {
  const link = createBrowserExtensionLink('background');
  const receiver = new MusubiReceiver(schema, [
    link.receiver,
  ]);

  receiver.handleQuery('getTabs', async () => {
    return browser.tabs.query({});
  });

  console.info('background script ready');
}

main().catch(console.error);


FAQs

Package last updated on 12 Apr 2024

Did you know?

Socket

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.

Install

Related posts