Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

webextension-polyfill-ts

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webextension-polyfill-ts - npm Package Compare versions

Comparing version 0.25.0 to 0.26.0

lib/action.d.ts

231

lib/browserAction.d.ts

@@ -5,4 +5,3 @@ /**

*
* Use browser actions to put icons in the main browser toolbar, to the right of the address bar. In addition to its icon, a browser action can also have a tooltip, a badge, and a popup.
* Permissions: "manifest:browser_action"
* Permissions: "manifest:action", "manifest:browser_action"
*

@@ -14,231 +13,7 @@ * Comments found in source JSON schema files:

*/
import { Tabs } from "./tabs";
import { Events } from "./events";
import { Action } from "./action";
export declare namespace BrowserAction {
/**
* Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
*/
interface Details {
/**
* When setting a value, it will be specific to the specified tab, and will automatically reset when the tab navigates. When getting, specifies the tab to get the value from; if there is no tab-specific value, the window one will be inherited.
* Optional.
*/
tabId?: number;
/**
* When setting a value, it will be specific to the specified window. When getting, specifies the window to get the value from; if there is no window-specific value, the global one will be inherited.
* Optional.
*/
windowId?: number;
interface Static extends Action.Static {
}
type ColorArray = [number, number, number, number];
/**
* Pixel data for an image. Must be an ImageData object (for example, from a <code>canvas</code> element).
*/
interface ImageDataType {
}
/**
* An array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque red is <code>[255, 0, 0, 255]</code>. Can also be a string with a CSS value, with opaque red being <code>#FF0000</code> or <code>#F00</code>.
*/
type ColorValue = string | ColorArray | null;
/**
* Information sent when a browser action is clicked.
*/
interface OnClickData {
/**
* An array of keyboard modifiers that were held while the menu item was clicked.
*/
modifiers: OnClickDataModifiersItemEnum[];
/**
* An integer value of button by which menu item was clicked.
* Optional.
*/
button?: number;
}
interface SetTitleDetailsType extends Details {
/**
* The string the browser action should display when moused over.
*/
title: string | null;
}
interface SetIconDetailsType extends Details {
/**
* Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals <code>scale</code>, then image with size <code>scale</code> * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}'
* Optional.
*/
imageData?: ImageDataType | {[s:string]:ImageDataType};
/**
* Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals <code>scale</code>, then image with size <code>scale</code> * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}'
* Optional.
*/
path?: string | {[s:string]:string};
}
interface SetPopupDetailsType extends Details {
/**
* The html file to show in a popup. If set to the empty string (''), no popup is shown.
*/
popup: string | null;
}
interface SetBadgeTextDetailsType extends Details {
/**
* Any number of characters can be passed, but only about four can fit in the space.
*/
text: string | null;
}
interface SetBadgeBackgroundColorDetailsType extends Details {
color: ColorValue;
}
interface SetBadgeTextColorDetailsType extends Details {
color: ColorValue;
}
type OnClickDataModifiersItemEnum = "Shift" | "Alt" | "Command" | "Ctrl" | "MacCtrl";
interface Static {
/**
* Sets the title of the browser action. This shows up in the tooltip.
*
* @param details
* @returns Promise<void>
*/
setTitle(details: SetTitleDetailsType): Promise<void>;
/**
* Gets the title of the browser action.
*
* @param details
* @returns Promise<string>
*/
getTitle(details: Details): Promise<string>;
/**
* Sets the icon for the browser action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the <b>path</b> or the <b>imageData</b> property must be specified.
*
* @param details
* @returns Promise<void>
*/
setIcon(details: SetIconDetailsType): Promise<void>;
/**
* Sets the html document to be opened as a popup when the user clicks on the browser action's icon.
*
* @param details
* @returns Promise<void>
*/
setPopup(details: SetPopupDetailsType): Promise<void>;
/**
* Gets the html document set as the popup for this browser action.
*
* @param details
* @returns Promise<string>
*/
getPopup(details: Details): Promise<string>;
/**
* Sets the badge text for the browser action. The badge is displayed on top of the icon.
*
* @param details
* @returns Promise<void>
*/
setBadgeText(details: SetBadgeTextDetailsType): Promise<void>;
/**
* Gets the badge text of the browser action. If no tab nor window is specified is specified, the global badge text is returned.
*
* @param details
* @returns Promise<string>
*/
getBadgeText(details: Details): Promise<string>;
/**
* Sets the background color for the badge.
*
* @param details
* @returns Promise<void>
*/
setBadgeBackgroundColor(details: SetBadgeBackgroundColorDetailsType): Promise<void>;
/**
* Gets the background color of the browser action badge.
*
* @param details
* @returns Promise<ColorArray>
*/
getBadgeBackgroundColor(details: Details): Promise<ColorArray>;
/**
* Sets the text color for the badge.
*
* @param details
*/
setBadgeTextColor(details: SetBadgeTextColorDetailsType): void;
/**
* Gets the text color of the browser action badge.
*
* @param details
*/
getBadgeTextColor(details: Details): void;
/**
* Enables the browser action for a tab. By default, browser actions are enabled.
*
* @param tabId Optional. The id of the tab for which you want to modify the browser action.
* @returns Promise<void>
*/
enable(tabId?: number): Promise<void>;
/**
* Disables the browser action for a tab.
*
* @param tabId Optional. The id of the tab for which you want to modify the browser action.
* @returns Promise<void>
*/
disable(tabId?: number): Promise<void>;
/**
* Checks whether the browser action is enabled.
*
* @param details
* @returns Promise<boolean>
*/
isEnabled(details: Details): Promise<boolean>;
/**
* Opens the extension popup window in the active window.
*
* @returns Promise<void>
*/
openPopup(): Promise<void>;
/**
* Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup.
*
* @param tab
* @param info Optional.
*/
onClicked: Events.Event<(tab: Tabs.Tab, info: OnClickData | undefined) => void>;
}
}

@@ -13,2 +13,3 @@ /**

*/
import { BrowserSettingsColorManagement } from "./browserSettings_colorManagement";
import { Types } from "./types";

@@ -28,2 +29,7 @@

/**
* Color management mode.
*/
type ColorManagementMode = "off" | "full" | "tagged_only";
interface Static {

@@ -52,7 +58,2 @@

/**
* This boolean setting controls whether the FTP protocol is enabled.
*/
ftpProtocolEnabled: Types.Setting;
/**
* Returns the value of the overridden home page. Read-only.

@@ -116,3 +117,5 @@ */

zoomSiteSpecific: Types.Setting;
colorManagement: BrowserSettingsColorManagement.Static;
}
}

@@ -16,10 +16,4 @@ /**

export declare namespace ContextMenus {
/**
* The different contexts a menu can appear in. Specifying 'all' is equivalent to the combination of all other contexts except for 'tab' and 'tools_menu'.
*/
type ContextType = "all" | "page" | "frame" | "selection" | "link" | "editable" | "password" | "image" | "video" | "audio" | "launcher" | "bookmark" | "browser_action" | "page_action" | "tab";
interface Static extends Menus.Static {
}
}

@@ -81,3 +81,3 @@ /**

*/
setObject(jsonObject: string, rootTitle?: string): Promise<void>;
setObject(jsonObject: string | Array<unknown> | Record<string, unknown>, rootTitle?: string): Promise<void>;

@@ -84,0 +84,0 @@ /**

@@ -40,24 +40,5 @@ /**

/**
* Set for the lifetime of a callback if an ansychronous extension api has resulted in an error. If no error has occured lastError will be <var>undefined</var>.
*/
interface PropertyLastErrorType {
/**
* Description of the error that has taken place.
*/
message: string;
}
interface Static {
/**
* Converts a relative path within an extension install directory to a fully-qualified URL.
*
* @param path A path to a resource within an extension expressed relative to its install directory.
* @returns string The fully-qualified URL to the resource.
*/
getURL(path: string): string;
/**
* Returns an array of the JavaScript 'window' objects for each of the pages running inside the current extension.

@@ -92,8 +73,2 @@ *

/**
* Set for the lifetime of a callback if an ansychronous extension api has resulted in an error. If no error has occured lastError will be <var>undefined</var>.
* Optional.
*/
lastError?: PropertyLastErrorType;
/**
* True for content scripts running inside incognito tabs, and for extension pages running inside an incognito process. The latter only applies to extensions with 'split' incognito_behavior.

@@ -100,0 +75,0 @@ * Optional.

@@ -11,3 +11,3 @@ /**

export declare namespace GeckoProfiler {
type ProfilerFeature = "java" | "js" | "leaf" | "mainthreadio" | "responsiveness" | "screenshots" | "seqstyle" | "stackwalk" | "tasktracer" | "threads" | "jstracer" | "jsallocations" | "nostacksampling" | "nativeallocations" | "preferencereads" | "ipcmessages" | "fileio" | "fileioall" | "noiostacks" | "audiocallbacktracing" | "cpu";
type ProfilerFeature = "java" | "js" | "leaf" | "mainthreadio" | "responsiveness" | "screenshots" | "seqstyle" | "stackwalk" | "threads" | "jstracer" | "jsallocations" | "nostacksampling" | "nativeallocations" | "preferencereads" | "ipcmessages" | "fileio" | "fileioall" | "noiostacks" | "audiocallbacktracing" | "cpu" | "notimerresolutionchange";

@@ -14,0 +14,0 @@ type supports = "windowLength";

import { ActivityLog } from "./activityLog";
import { Alarms } from "./alarms";
import { Bookmarks } from "./bookmarks";
import { Action } from "./action";
import { BrowserAction } from "./browserAction";

@@ -54,7 +55,10 @@ import { BrowserSettings } from "./browserSettings";

import { Windows } from "./windows";
import { Scripting } from "./scripting";
export { ActivityLog } from "./activityLog";
export { Alarms } from "./alarms";
export { Bookmarks } from "./bookmarks";
export { Action } from "./action";
export { BrowserAction } from "./browserAction";
export { BrowserSettings } from "./browserSettings";
export { BrowserSettingsColorManagement } from "./browserSettings_colorManagement";
export { BrowsingData } from "./browsingData";

@@ -114,2 +118,3 @@ export { CaptivePortal } from "./captivePortal";

export { Windows } from "./windows";
export { Scripting } from "./scripting";

@@ -120,2 +125,3 @@ export interface Browser {

bookmarks: Bookmarks.Static;
action: Action.Static;
browserAction: BrowserAction.Static;

@@ -171,4 +177,5 @@ browserSettings: BrowserSettings.Static;

windows: Windows.Static;
scripting: Scripting.Static;
}
export declare const browser: Browser;

@@ -125,3 +125,3 @@ /**

*/
web_accessible_resources?: string[];
web_accessible_resources?: string[] | WebExtensionManifestWebAccessibleResourcesC2ItemType[];

@@ -141,3 +141,3 @@ /**

*/
browser_action?: WebExtensionManifestBrowserActionType;
action?: ActionManifest;

@@ -147,2 +147,7 @@ /**

*/
browser_action?: ActionManifest;
/**
* Optional.
*/
chrome_settings_overrides?: WebExtensionManifestChromeSettingsOverridesType;

@@ -378,2 +383,37 @@

interface ActionManifest {
/**
* Optional.
*/
default_title?: string;
/**
* Optional.
*/
default_icon?: IconPath;
/**
* Specifies icons to use for dark and light themes
* Optional.
*/
theme_icons?: ThemeIcons[];
/**
* Optional.
*/
default_popup?: string;
/**
* Optional.
*/
browser_style?: boolean;
/**
* Defines the location the browserAction will appear by default. The default location is navbar.
* Optional.
*/
default_area?: ActionManifestDefaultAreaEnum;
}
type KeyName = string;

@@ -394,3 +434,3 @@

*/
protocol: "bitcoin" | "dat" | "dweb" | "geo" | "gopher" | "im" | "ipfs" | "ipns" | "irc" | "ircs" | "magnet" | "mailto" | "mms" | "news" | "nntp" | "sip" | "sms" | "smsto" | "ssb" | "ssh" | "tel" | "urn" | "webcal" | "wtai" | "xmpp" | string;
protocol: "bitcoin" | "dat" | "dweb" | "ftp" | "geo" | "gopher" | "im" | "ipfs" | "ipns" | "irc" | "ircs" | "magnet" | "mailto" | "matrix" | "mms" | "news" | "nntp" | "sip" | "sms" | "smsto" | "ssb" | "ssh" | "tel" | "urn" | "webcal" | "wtai" | "xmpp" | string;

@@ -549,3 +589,4 @@ /**

interface WebExtensionManifestDeveloperType {
interface WebExtensionManifestWebAccessibleResourcesC2ItemType {
resources: string[];

@@ -555,3 +596,3 @@ /**

*/
name?: string;
matches?: MatchPatternRestricted[];

@@ -561,16 +602,11 @@ /**

*/
url?: string;
extensions?: ExtensionID[];
}
/**
* Defines the location the browserAction will appear by default. The default location is navbar.
*/
type WebExtensionManifestBrowserActionDefaultAreaEnum = "navbar" | "menupanel" | "tabstrip" | "personaltoolbar";
interface WebExtensionManifestDeveloperType {
interface WebExtensionManifestBrowserActionType {
/**
* Optional.
*/
default_title?: string;
name?: string;

@@ -580,25 +616,3 @@ /**

*/
default_icon?: IconPath;
/**
* Specifies icons to use for dark and light themes
* Optional.
*/
theme_icons?: ThemeIcons[];
/**
* Optional.
*/
default_popup?: string;
/**
* Optional.
*/
browser_style?: boolean;
/**
* Defines the location the browserAction will appear by default. The default location is navbar.
* Optional.
*/
default_area?: WebExtensionManifestBrowserActionDefaultAreaEnum;
url?: string;
}

@@ -872,2 +886,7 @@

/**
* Defines the location the browserAction will appear by default. The default location is navbar.
*/
type ActionManifestDefaultAreaEnum = "navbar" | "menupanel" | "tabstrip" | "personaltoolbar";
interface ThemeExperimentImagesType {

@@ -971,7 +990,2 @@ }

*/
toolbar_field_separator?: ThemeColor;
/**
* Optional.
*/
toolbar_top_separator?: ThemeColor;

@@ -978,0 +992,0 @@

@@ -22,3 +22,3 @@ /**

*/
type ContextType = "all" | "page" | "frame" | "selection" | "link" | "editable" | "password" | "image" | "video" | "audio" | "launcher" | "bookmark" | "browser_action" | "page_action" | "tab" | "tools_menu";
type ContextType = "all" | "page" | "frame" | "selection" | "link" | "editable" | "password" | "image" | "video" | "audio" | "launcher" | "bookmark" | "tab" | "tools_menu" | "browser_action" | "page_action" | "action";

@@ -222,6 +222,6 @@ /**

/**
* Specifies a command to issue for the context click. Currently supports internal commands _execute_page_action, _execute_browser_action and _execute_sidebar_action.
* Specifies a command to issue for the context click.
* Optional.
*/
command?: string;
command?: string | "_execute_browser_action" | "_execute_page_action" | "_execute_sidebar_action" | "_execute_action" | "_execute_page_action" | "_execute_sidebar_action";
}

@@ -228,0 +228,0 @@

@@ -38,3 +38,3 @@ /**

*/
type NetworkLinkInfoTypeEnum = "unknown" | "ethernet" | "usb" | "wifi" | "wimax" | "2g" | "3g" | "4g";
type NetworkLinkInfoTypeEnum = "unknown" | "ethernet" | "usb" | "wifi" | "wimax" | "mobile";

@@ -41,0 +41,0 @@ interface Static {

@@ -38,8 +38,2 @@ /**

/**
* The address of the ftp proxy, can include a port.
* Optional.
*/
ftp?: string;
/**
* The address of the ssl proxy, can include a port.

@@ -46,0 +40,0 @@ * Optional.

@@ -280,2 +280,10 @@ /**

/**
* Attempts to connect to connect listeners within an extension/app (such as the background page), or other extensions/apps. This is useful for content scripts connecting to their extension processes, inter-app/extension communication, and $(topic:manifest/externally_connectable)[web messaging]. Note that this does not connect to any listeners in a content script. Extensions may connect to content scripts embedded in tabs via $(ref:tabs.connect).
*
* @param connectInfo Optional.
* @returns Port Port through which messages can be sent and received. The port's $(ref:runtime.Port onDisconnect) event is fired if the extension/app does not exist.
*/
connect(connectInfo?: ConnectConnectInfoType): Port;
/**
* Connects to a native application in the host machine.

@@ -282,0 +290,0 @@ *

@@ -437,3 +437,3 @@ /**

*/
type UpdatePropertyName = "attention" | "audible" | "discarded" | "favIconUrl" | "hidden" | "isArticle" | "mutedInfo" | "pinned" | "sharingState" | "status" | "title";
type UpdatePropertyName = "attention" | "audible" | "discarded" | "favIconUrl" | "hidden" | "isArticle" | "mutedInfo" | "pinned" | "sharingState" | "status" | "title" | "url";

@@ -440,0 +440,0 @@ /**

{
"name": "webextension-polyfill-ts",
"version": "0.25.0",
"version": "0.26.0",
"description": "webextension-polyfill for TypeScript",

@@ -42,16 +42,16 @@ "keywords": [

"dependencies": {
"webextension-polyfill": "^0.7.0"
"webextension-polyfill": "^0.8.0"
},
"devDependencies": {
"@lusito/eslint-config": "^1.5.0",
"@lusito/prettier-config": "^1.5.0",
"@lusito/stylelint-config": "^1.5.0",
"@types/node": "^14.14.27",
"@lusito/eslint-config": "^1.6.1",
"@lusito/prettier-config": "^1.6.0",
"@lusito/stylelint-config": "^1.6.0",
"@types/node": "^16.0.0",
"@types/rimraf": "^3.0.0",
"got": "^11.8.1",
"got": "^11.8.2",
"rimraf": "^3.0.2",
"sort-package-json": "^1.48.1",
"ts-node": "^9.1.1",
"typescript": "^4.1.5"
"sort-package-json": "^1.50.0",
"ts-node": "^10.0.0",
"typescript": "^4.3.5"
}
}
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