Visual Selector direct element finder fix

pull/777/head
dgtlmoon 2 years ago
parent f2b8888aff
commit e6173357a9

@ -63,12 +63,12 @@ class Fetcher():
break; break;
} }
if('' !==r.id) { if('' !==r.id) {
chained_css.unshift("#"+r.id); chained_css.unshift("#"+CSS.escape(r.id));
final_selector= chained_css.join('>'); final_selector= chained_css.join(' > ');
// Be sure theres only one, some sites have multiples of the same ID tag :-( // Be sure theres only one, some sites have multiples of the same ID tag :-(
if (window.document.querySelectorAll(final_selector).length ==1 ) { if (window.document.querySelectorAll(final_selector).length ==1 ) {
return final_selector; return final_selector;
} }
return null; return null;
} else { } else {
chained_css.unshift(r.tagName.toLowerCase()); chained_css.unshift(r.tagName.toLowerCase());

Loading…
Cancel
Save