I am able to replace the JavaScript file, which is served by a webpage and Chrome will use my changed script. Here is the solution:
manifest.json