puppeteer
Advanced tools
Comparing version 1.0.0-next.1516669982697 to 1.0.0-next.1516857257758
@@ -545,6 +545,6 @@ /** | ||
*/ | ||
async select(selector, ...values){ | ||
select(selector, ...values){ | ||
for (const value of values) | ||
console.assert(helper.isString(value), 'Values must be strings. Found value "' + value + '" of type "' + (typeof value) + '"'); | ||
return await this.$eval(selector, (element, values) => { | ||
return this.$eval(selector, (element, values) => { | ||
if (element.nodeName.toLowerCase() !== 'select') | ||
@@ -555,4 +555,7 @@ throw new Error('Element is not a <select> element.'); | ||
element.value = undefined; | ||
for (const option of options) | ||
for (const option of options) { | ||
option.selected = values.includes(option.value); | ||
if (option.selected && !element.multiple) | ||
break; | ||
} | ||
element.dispatchEvent(new Event('input', { 'bubbles': true })); | ||
@@ -559,0 +562,0 @@ element.dispatchEvent(new Event('change', { 'bubbles': true })); |
{ | ||
"name": "puppeteer", | ||
"version": "1.0.0-next.1516669982697", | ||
"version": "1.0.0-next.1516857257758", | ||
"description": "A high-level API to control headless Chrome over the DevTools Protocol", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
255873
6437