1

I have an idea for the beginnings of a Chrome Dev Tools extension, it involves intercepting user input into Chrome Dev Tools. Is this possible?

E.g., a simple use would be to intercept the word 'hi' typed into the dev tools and then output 'hello' back to the user.

Just for some context, right now when you type 'hi' it shows this:

enter image description here

    1 Answer 1

    2

    This is not possible with the current API. It could lead to abuse by developers pretty easily.

    There is talk going on for an API to allow adding preprocessor support to the console, say writing CoffeeScript or TypeScript instead of pure JavaScript into the console. That is still in early discussion stages as far as I know.

    What is the use-case for intercepting commands like this? A simple "hi" in and "hello" out doesn't seem useful at all. This kind of thing would only lead to possibly confusing developers about what is defined in a page.

    3
    • I want to check if the value entered into the console evaluates to a promise and then when the promise completes write that value to the console. E.g., getPromise() -> Promise -> settledValue. This would be super helpful. How do you feel about this use case?CommentedJun 25, 2015 at 21:31
    • 1
      I think this use-case would be better filled through the Promises panel (currently still experimental.) So, when you fire a promise off from the console, it will show in the panel as well, with the current state and everything. This will negate the need to use the console as much and provide a great UX. As of right now, the panel does not catch promises from the console, but I'll pass the feedback along to the developers to see if we can't make it happen.
      – Garbee
      CommentedJun 29, 2015 at 20:26
    • @Garbee I know it's 7 years later - was wondering it this had changed and whether it is now possible to track / consume / monitor user input in the Chrome Dev Tools? Unsure where I can find this information so would be also very grateful as to which docs I should be looking at
      – user7269511
      CommentedJul 27, 2022 at 18:00

    Start asking to get answers

    Find the answer to your question by asking.

    Ask question

    Explore related questions

    See similar questions with these tags.