new CDPRuntimeDomainTest(
'devtools-console',
'Either Devtools Console is open or CDP Runtime Domain is enabled'
)
/**
* Detects CDP Runtime Domain enabled.
*
* see https://source.chromium.org/chromium/chromium/src/+/main:v8/src/inspector/v8-runtime-agent-impl.cc;l=992
*/
class CDPRuntimeDomainTest extends SeleniumDetectionTest {
test(window) {
let stackLookup = false;
const e = new window.Error();
// there might be several ways to catch property access from console print functions
window.Object.defineProperty(e, 'stack', {
configurable: false,
enumerable: false,
get: function() {
stackLookup = true;
return '';
}
});
// can be bypassed by patching all console print functions
window.console.debug(e);
return stackLookup;
}
}
Hi, @HMaker. Just wonder how could we bypass the CDPRuntimeDomainTest?
// can be bypassed by patching all console print functions
window.console.debug(e);
Don't understand how to do this. Do you mean by commenting on all console.log() usages in the js code?
https://github.com/HMaker/HMaker.github.io/blob/master/selenium-detector/chromedriver.js
Hi, @HMaker. Just wonder how could we bypass the
CDPRuntimeDomainTest
?Don't understand how to do this. Do you mean by commenting on all
console.log()
usages in the js code?