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

chrome-pool

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chrome-pool - npm Package Compare versions

Comparing version 1.1.1 to 1.1.3

8

index.js

@@ -161,9 +161,9 @@ 'use strict';

*/
release(tabId) {
async release(tabId) {
let tab = this.tabs[tabId];
tab.free = true;
// navigate this tab to blank to release this tab's resource
// https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-navigate
tab.protocol.Page.navigate({ url: 'about:blank' });
await tab.protocol.Page.navigate({ url: 'about:blank' });
tab.free = true;

@@ -176,3 +176,3 @@ // remove all listeners to fix MaxListenersExceededWarning: Possible EventEmitter memory leak detected

});
})
});

@@ -179,0 +179,0 @@ if (this.requireResolveTasks.length > 0) {

{
"name": "chrome-pool",
"version": "1.1.1",
"version": "1.1.3",
"description": "headless chrome tabs manage pool",

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

@@ -45,7 +45,5 @@ 'use strict';

console.log(`${maxTab} tabs has created, next require will return util a tab has be released after 2s`);
setTimeout(() => {
chromePoll.release(tabId1);
chromePoll.release(tabId2);
chromePoll.release(tabId3);
chromePoll.release(tabId4);
setTimeout(async () => {
let task = [chromePoll.release(tabId1), chromePoll.release(tabId2), chromePoll.release(tabId3), chromePoll.release(tabId4)];
await Promise.all(task);
Object.keys(chromePoll.tabs).forEach(tabId => {

@@ -70,3 +68,3 @@ assert.equal(chromePoll.tabs[tabId].free, true, 'all tabs should be free now');

assert.equal(chromePoll.tabs[client.tabId].free, false, 'after require tab should be busy');
chromePoll.release(client.tabId);
await chromePoll.release(client.tabId);
assert.equal(chromePoll.tabs[client.tabId].free, true, 'after release tab should be free');

@@ -73,0 +71,0 @@ return await chromePoll.destroyPoll();

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