I have written a javascript code to print the active function calls of a webpage. When I paste the code in the console I can see the active functions in the console and the problem is with the extension. I converted the javascript code to google chrome extension and it is not working. I am new to extension creation.
Plugin Code:
manifest.json
{
  "manifest_version": 2,
  "name": "example",
  "version": "0.1",
  "description": "My Chrome Extension",
  "icons": {
  },
  "background": {
    "scripts": [
      "js/background.js"
    ]
  },
  "browser_action": {
    "default_title": "My test Environment"
  },
  "permissions": [
    "background",
    "storage",
    "tabs",
    "http://*/*",
    "https://*/*"
  ]
}
js/background.js
function tracecalls(par) {
    for (var name in window) {
        if (typeof window[name] === 'function') {
            window[name] = (function (fname, f) {
                return function () {
                    par(fname);
                    return f.apply(this, arguments);
                }
            }(name, window[name]));
        }
    }
}
tracecalls(function (fname) {
    console.log("Function Name : " + fname);
});
 
     
     
    