From 152bc516c271126b570d57ff5770cdf9c730181b Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Sun, 29 Aug 2021 09:21:58 +0900 Subject: [PATCH] Update chrome.js --- lib/chrome.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/chrome.js b/lib/chrome.js index b7c4d04..cb92ac1 100644 --- a/lib/chrome.js +++ b/lib/chrome.js @@ -558,7 +558,9 @@ var ChromeObject = function() { s += '(function() {' + ' var elements = Object.values(document.querySelectorAll("' + selector + '")).filter(function(x) {' + ' var el = x.querySelector("' + subSelector + '");' - + ' return ([el.innerText, el.getAttribute("aria-label"), el.getAttribute("class")].join(" ").indexOf(decodeURIComponent("' + encodeURIComponent(searchText) + '")) > -1);' + + ' var keywords = decodeURIComponent("' + encodeURIComponent(searchText) + '").split(" ");' + + ' var text = [el.innerText, el.getAttribute("aria-label"), el.getAttribute("class")].join(" ");' + + ' return (text.split(" ").filter(function(w) { return keywords.indexOf(w) > -1; }).length >= keywords.length);' + ' });' + ' if (elements.length > 0) {' + ' var rect = elements[0].getBoundingClientRect();'