content.js code example
Example 1: google chrome extensions content scripts matches
in your manifest.json:
"content_scripts": [
{
"matches": ["http://*.nytimes.com/*"],
"css": ["myStyles.css"],
"js": ["contentScript.js"]
}
],
Example 2: set text of dom element
document.getElementById("myBtn").textContent = 'Hello World';