Update chrome.js

This commit is contained in:
Namhyeon Go 2021-08-29 09:05:44 +09:00 committed by GitHub
parent d6c578dca3
commit 729e84bd8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -557,7 +557,8 @@ var ChromeObject = function() {
if (searchText.indexOf(':p(') != 0) {
s += '(function() {'
+ ' var elements = Object.values(document.querySelectorAll("' + selector + '")).filter(function(x) {'
+ ' return (x.querySelector("' + subSelector + '").innerText.indexOf(decodeURIComponent("' + encodeURIComponent(searchText) + '")) > -1);'
+ ' var el = x.querySelector("' + subSelector + '");'
+ ' return ([el.innerText, el.getAttribute("aria-label"), el.getAttribute("class")].join(" ").indexOf(decodeURIComponent("' + encodeURIComponent(searchText) + '")) > -1);'
+ ' });'
+ ' if (elements.length > 0) {'
+ ' var rect = elements[0].getBoundingClientRect();'