Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Enhance waitForSelector JavaScript error message #1462

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions common/js/injected_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,6 @@ class InjectedScript {

waitForSelector(selector, root, strict, state, polling, timeout, ...args) {
let lastElement;
let previewNode = this.previewNode;
const predicate = () => {
const elements = this.querySelectorAll(selector, root || document);
const element = elements[0];
Expand All @@ -993,7 +992,7 @@ class InjectedScript {
if (lastElement !== element) {
lastElement = element;
if (!element) {
console.log(` selector did not resolve to any element`);
console.log(` ${selector} did not match any elements`);
} else {
if (elements.length > 1) {
if (strict) {
Expand Down
Loading