Skip to content

Commit 2ddefe5

Browse files
committed
fix: enforce returning string for eval
1 parent e0507ad commit 2ddefe5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/detectors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ async function match (detector, { originalHtml, html, scripts, page }) {
8888
// JS eval (for string value)
8989
if (detector.eval) {
9090
for (const js of asArray(detector.eval)) {
91-
const value = await page.evaluate(js)
91+
const value = await page.evaluate(`String(${js})`)
9292
if (value) return value
9393
}
9494
return null

0 commit comments

Comments
 (0)