chrome扩展入门

manifest.json file

 

{
"manifest_version": 2,
"version": "1.0",
"name": "My First Extension",
"description": "The first extension that I made.",
"content_scripts": [
{
"matches": ["http://tb7-bmgmt-01/servicemanager/*"],
"js": ["foo.js"]
}
]
}

 

foo.js:

// checked all checkbox in the page.

var dd = document.getElementsByTagName("input")

for (i = 0; i < dd.length; i++) {

   if (dd[i].type == 'checkbox') {

        dd[i].checked =true;

    }

var ddl=document.getElementsByTagName("select")
for(j=1;j<ddl.length;j++)
{
if(ddl[j].name.indexOf("ddlRepl_") >= 0 )
{
   ddl[j].selectedIndex =4;
}

}

}

 

url: https://developer.chrome.com/extensions/getstarted



你可能感兴趣的:(chrome扩展入门)