Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
apollo-link-webextensions-messaging
Advanced tools
> Apollo link that, in a WebExtension, forwards GraphQL operations between processes
Apollo link that, in a WebExtension, forwards GraphQL operations between processes
npm i -S apollo-link-webextensions-messaging
reactive-graphql
and apollo-link-reactive-schema
Port
creation method: adaptable for cross-extension messaging or native messagingPort
(and esp. MessageSender
) in local GraphQL resolvers// ------------------
// in background page
import { createWebExtensionMessagingExecutorListener } from 'apollo-link-webextensions-messaging';
import { SchemaLink } from 'apollo-link-schema';
import schema from './path/to/your/schema';
// local schema execution
const link = new SchemaLink({
schema,
context: operation => ({
// `createWebExtensionMessagingExecutorListener` will
// add `port`, the `onConnect`'s `Port` as Operation's context
// we extract the `MessageSender` into GQL's context so that
// it can be used in resolvers
sender: operation.getContext().port.sender,
})
});
const listener = createWebExtensionMessagingExecutorListener({
link,
});
chrome.runtime.onConnect.addListener(listener);
// ----------------
// in content script
import { createWebExtensionsMessagingLink } from 'apollo-link-webextensions-messaging';
import { ApolloClient } from 'apollo-client';
import { InMemoryCache } from 'apollo-cache-inmemory';
const port = chrome.runtime.connect();
const client = new ApolloClient({
// can also be `createWebExtensionsMessagingLink((operation) => port)`
link: createWebExtensionsMessagingLink(port),
cache: new InMemoryCache(),
// from experience, if `queryDeduplication` is true,
// `client.watchQuery` unsubscription will not be
// properly passed down to the `link`
queryDeduplication: false,
});
client.query(MY_QUERY);
FAQs
> Apollo link that, in a WebExtension, forwards GraphQL operations between processes
We found that apollo-link-webextensions-messaging demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.