How to get Extension to read specific part of console in Chrome?

I wanna create a Chrome extension that needs to read a specific part which the website posts into the console. Here you can see this part:

Picture of the part in console

I need specifically the "questionsList" part.

How do I do that in the JS of my Extension?

41 thoughts on “How to get Extension to read specific part of console in Chrome?”

  1. As the other user said, overriding the console.log method will be the easier way. You can then iterate over the arguments passed in to the console.log function and see if one of the arguments is an object that has a property named "questionList", and if it does it should store its value in a global object named questionList. You can inject this code in the console:

    let oldConsole=window.console
    let questionList=[];
    let console=(function(oldConsole){
           return {
                    for(arg of args){
                      if(typeof arg==="object" && "questionList" in arg){

    Now whenever the console logs that particular object you can access this array from the questionList global variable.


Leave a Comment