New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

webext-content-scripts

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webext-content-scripts - npm Package Compare versions

Comparing version 0.8.0 to 0.9.0

6

index.d.ts
/// <reference types="chrome" />
declare type ContentScripts = NonNullable<chrome.runtime.Manifest['content_scripts']>;
export declare function injectContentScript(tabId: number, scripts: ContentScripts | ContentScripts[0]): Promise<void>;
interface Target {
tabId: number;
frameId: number;
}
export declare function injectContentScript(target: number | Target, scripts: ContentScripts | ContentScripts[0]): Promise<void>;
export {};

@@ -7,4 +7,8 @@ function castArray(possibleArray) {

}
export async function injectContentScript(tabId, scripts) {
export async function injectContentScript(target, scripts) {
var _a, _b;
const { frameId, tabId } = typeof target === 'object' ? target : {
tabId: target,
frameId: 0,
};
const injections = [];

@@ -15,2 +19,3 @@ for (const script of castArray(scripts)) {

file,
frameId,
runAt: script.run_at,

@@ -24,2 +29,3 @@ allFrames: script.all_frames,

file,
frameId,
runAt: script.run_at,

@@ -26,0 +32,0 @@ allFrames: script.all_frames,

2

package.json
{
"name": "webext-content-scripts",
"version": "0.8.0",
"version": "0.9.0",
"description": "Utility functions to inject content scripts from a WebExtension.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -44,4 +44,6 @@ # webext-content-scripts [![npm version](https://img.shields.io/npm/v/webext-content-scripts.svg)](https://www.npmjs.com/package/webext-content-scripts)

```js
const tabId = 42;
injectContentScript(tabId, [
injectContentScript({
tabId: 42,
frameId: 56
}, [
{

@@ -48,0 +50,0 @@ js: [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc