Update chrome.js

This commit is contained in:
Namhyeon Go 2021-08-31 13:53:11 +09:00 committed by GitHub
parent bcea5de97c
commit 8d7a5ddcc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -561,7 +561,7 @@ var ChromeObject = function() {
+ ' var elements = Object.values(document.querySelectorAll("' + selector + '")).filter(function(x) {'
+ ' var el = x.querySelector("' + subSelector + '");'
+ ' var keywords = decodeURIComponent("' + encodeURIComponent(searchText) + '").split(" ");'
+ ' var text = [el.innerText, el.getAttribute("aria-label"), el.getAttribute("class")].join(" ");'
+ ' var text = el instanceof HTMLElement ? [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) {'