mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-12 04:31:04 +00:00
Update chrome.js
This commit is contained in:
parent
729e84bd8c
commit
152bc516c2
|
@ -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();'
|
||||
|
|
Loading…
Reference in New Issue
Block a user