Update chrome.js

This commit is contained in:
Namhyeon Go 2023-12-27 03:31:54 +09:00
parent 285e90494d
commit 80dfe4c915

View File

@ -1183,6 +1183,10 @@ var ChromeObject = function(interfaces) {
return this.evaluate('__getWindow().addEventListener("click",function(e){var t=e.clientX,n=e.clientY,l=__getDocument().createElement("div");l.style.position="absolute",l.style.width="20px",l.style.height="20px",l.style.backgroundColor="#00ff00",l.style.zIndex=99999,l.style.top=__getWindow().pageYOffset+n-10+"px",l.style.left=__getWindow().pageXOffset+t-10+"px",__getDocument().body.appendChild(l)});');
};
this.markPosition = function(x, y) {
return this.evaluate('(function(x, y){var t=x,n=y,l=__getDocument().createElement("div");l.style.position="absolute",l.style.width="20px",l.style.height="20px",l.style.backgroundColor="#ff0000",l.style.zIndex=99999,l.style.top=__getWindow().pageYOffset+n-10+"px",l.style.left=__getWindow().pageXOffset+t-10+"px",__getDocument().body.appendChild(l)})(' + parseInt(x) + ', ' + parseInt(y) + ');');
};
// Added in 2023-12-27
this.getTextsBySelectorAll = function(selector) {
return JSON.parse(this.getEvaluatedValue('JSON.stringify(Object.values(__getDocument().querySelectorAll("' + selector + '")).reduce(function(a, x) { a.push(x.innerText); return a; }, []))'));
@ -1372,7 +1376,7 @@ exports.startDebugInPrivate = function(url, proxy, profileName, debuggingPort, i
;
};
exports.VERSIONINFO = "Chrome Web Browser Debugging Interface (chrome.js) version 0.4.5";
exports.VERSIONINFO = "Chrome Web Browser Debugging Interface (chrome.js) version 0.4.6";
exports.AUTHOR = "abuse@catswords.net";
exports.global = global;
exports.require = global.require;