selenium-webdriver
Advanced tools
Comparing version 4.8.0 to 4.8.1
@@ -0,1 +1,16 @@ | ||
## v4.8.1 | ||
#### :rocket: New Feature | ||
* Add script pinning (#11584) | ||
#### :nail_care: Polish | ||
* Add CDP support for v110 and remove v107 | ||
* Updating Selenium Manager binaries for 4.8.1 release | ||
#### :bug: Bug Fix | ||
fix: iedriver download with selenium-manager #11579 | ||
## v4.8.0 | ||
@@ -2,0 +17,0 @@ |
@@ -33,3 +33,3 @@ // Licensed to the Software Freedom Conservancy (SFC) under one | ||
*/ | ||
const Browser = ['chrome', 'firefox', 'edge'] | ||
const Browser = ['chrome', 'firefox', 'edge', 'iexplorer'] | ||
@@ -36,0 +36,0 @@ /** |
@@ -18,2 +18,3 @@ // Licensed to the Software Freedom Conservancy (SFC) under one | ||
const RESPONSE_TIMEOUT = 1000 * 30 | ||
class CDPConnection { | ||
@@ -39,4 +40,40 @@ constructor(wsConnection) { | ||
} | ||
async send(method, params) { | ||
let cdp_id = this.cmd_id++ | ||
let message = { | ||
method, | ||
id: cdp_id, | ||
} | ||
if (this.sessionId) { | ||
message['sessionId'] = this.sessionId | ||
} | ||
const mergedMessage = Object.assign({ params: params }, message) | ||
this._wsConnection.send(JSON.stringify(mergedMessage)) | ||
return new Promise((resolve, reject) => { | ||
const timeoutId = setTimeout(() => { | ||
reject(new Error(`Request with id ${cdp_id} timed out`)) | ||
handler.off('message', listener) | ||
}, RESPONSE_TIMEOUT) | ||
const listener = (data) => { | ||
try { | ||
const payload = JSON.parse(data.toString()) | ||
if (payload.id === cdp_id) { | ||
clearTimeout(timeoutId) | ||
handler.off('message', listener) | ||
resolve(payload) | ||
} | ||
} catch (err) { | ||
console.error(`Failed parse message: ${err.message}`) | ||
} | ||
} | ||
const handler = this._wsConnection.on('message', listener) | ||
}) | ||
} | ||
} | ||
exports.CdpConnection = CDPConnection |
@@ -409,3 +409,3 @@ // Licensed to the Software Freedom Conservancy (SFC) under one | ||
try { | ||
exe = driverLocation(Browser.INTERNET_EXPLORER) | ||
exe = driverLocation('iexplorer') | ||
} catch (err) { | ||
@@ -412,0 +412,0 @@ console.log(`Unable to obtain driver using Selenium Manager: ${err}`) |
{ | ||
"name": "selenium-webdriver", | ||
"version": "4.8.0", | ||
"version": "4.8.1", | ||
"description": "The official WebDriver JavaScript bindings from the Selenium project", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
13212066
63
16615
8