How can I create an Chrome extension, which will add an icon to the toolbar, and when icon clicked, it will run my script:
function rewrite() {
janbm_showpass:var a = document.getElementsByTagName('input'); for (var i = 0; i < a.length; i++) { if (a[i].hasAttribute('type') && a[i].type === 'password') a[i].type = 'text'; } void 0
}
It changes stars into text. But the question is how tu run in when icon clicked. I don’t want to create any popups and html.
Here is my manifest.json. Is it good?
{
"name": "Show password",
"version": "1.0",
"manifest_version": 2,
"description": "The extension",
"browser_action": {
"default_icon": "icon.png",
},
"background": {
"scripts": ["show_pass.js"]
}
}
You can use this skeleton, your code has an extra trailing comma
manifest.json
*show_pass.js*