🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

webext-tools

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webext-tools - npm Package Compare versions

Comparing version
4.0.2
to
4.1.0
+2
-0
distribution/create-context-menu.d.ts
export type ClickListener = (data: chrome.contextMenus.OnClickData, tab: chrome.tabs.Tab) => void;
/** Throws an error due to misconfiguration, unless misconfiguration can't be verified (Firefox cleans the manifest of unknown properties) */
export declare function notifyOfMissingPermissions(): void;
export default function createContextMenu(settings: Omit<chrome.contextMenus.CreateProperties, 'contexts'> & {

@@ -3,0 +5,0 @@ id: string;

+7
-3

@@ -10,4 +10,8 @@ import chromeP from 'webext-polyfill-kinda';

}
/* Throws an error due to misconfiguration, unless misconfiguration can't be verified (Firefox cleans the manifest of unknown properties) */
function warnOrThrow() {
/** Throws an error due to misconfiguration, unless misconfiguration can't be verified (Firefox cleans the manifest of unknown properties) */
export function notifyOfMissingPermissions() {
// Internal check before warning
if (chrome.contextMenus) {
return;
}
const manifest = chrome.runtime.getManifest();

@@ -27,3 +31,3 @@ if (!manifest.permissions?.includes('contextMenus')

if (!chrome.contextMenus) {
warnOrThrow();
notifyOfMissingPermissions();
return;

@@ -30,0 +34,0 @@ }

{
"name": "webext-tools",
"version": "4.0.2",
"version": "4.1.0",
"description": "Utility functions for Web Extensions",

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