logoalt Hacker News

kube-system • today at 7:41 AM • 0 replies • view on HN

You can detect any debugger attached to any browser running V8 with:

    let cdp = false;
    const orig = Error.prepareStackTrace;
    Error.prepareStackTrace = function () {
      cdp = true;
      return orig;
    };
    console.log(new Error(''));
    // cdp === true  → a debugger/automation client has the Runtime domain enabled