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

webext-schema

Package Overview
Dependencies
Maintainers
1
Versions
190
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webext-schema - npm Package Compare versions

Comparing version 5.2.10 to 5.3.0

38

modules/browser.js

@@ -993,2 +993,40 @@ /**

/**
* capture visible tab
* @param {number} windowId - window ID
* @param {object} opt - options
* @returns {Promise.<?string>} - data URL
*/
export const captureVisibleTab = async (windowId, opt) => {
const info = await runtime.getBrowserInfo();
let isGranted;
if (info.vender === 'Mozilla') {
const browserVersion = parseFloat(info.version);
isGranted = (browserVersion >= 126 && await isPermissionGranted({
permissions: ['activeTab']
})) || await isPermissionGranted({
origins: ['<all_urls>']
});
} else {
isGranted = await isPermissionGranted({
permissions: ['activeTab']
}) || await isPermissionGranted({
origins: ['<all_urls>']
});
}
let url;
if (isGranted) {
if (!Number.isInteger(windowId)) {
windowId = windows.WINDOW_ID_CURRENT;
}
if (!opt) {
opt = {
format: 'png'
};
}
url = await tabs.captureVisibleTab(windowId, opt);
}
return url ?? null;
};
/**
* is tab

@@ -995,0 +1033,0 @@ * @param {*} tabId - tab ID

16

package.json

@@ -24,3 +24,3 @@ {

"@types/firefox-webext-browser": "^120.0.3",
"@types/node": "^20.11.30",
"@types/node": "^20.12.7",
"@types/sinon": "^17.0.3",

@@ -32,9 +32,9 @@ "c8": "^9.1.0",

"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsdoc": "^48.2.1",
"eslint-plugin-regexp": "^2.3.0",
"eslint-plugin-unicorn": "^51.0.1",
"mocha": "^10.3.0",
"eslint-plugin-jsdoc": "^48.2.3",
"eslint-plugin-regexp": "^2.5.0",
"eslint-plugin-unicorn": "^52.0.0",
"mocha": "^10.4.0",
"npm-run-all": "^4.1.5",
"typescript": "^5.4.2",
"undici": "^6.9.0"
"typescript": "^5.4.5",
"undici": "^6.13.0"
},

@@ -59,3 +59,3 @@ "scripts": {

},
"version": "5.2.10"
"version": "5.3.0"
}

@@ -53,2 +53,3 @@ export function isPermissionGranted(perm: object): Promise<boolean>;

export function warmupTab(tabId: number): Promise<void>;
export function captureVisibleTab(windowId: number, opt: object): Promise<string | null>;
export function isTab(tabId: any): Promise<boolean>;

@@ -55,0 +56,0 @@ export function getCurrentTheme(windowId?: number): Promise<object>;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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