Reputation: 885
I am trying to make a chrome extension for fun purpose and I am newbie in Google Chrome-extensions.
Here is the scenario. I am trying to access the page specific tags e.g. input
and manipulating with their attributes i.e. assign/change their types.
Could you please give me some helps?
Thanks
Upvotes: 0
Views: 30
Reputation: 568
You'll need a content script that runs at (run_at
) the end of the document (document_end
).
See the docs for more info on that: https://developer.chrome.com/extensions/content_scripts
In your content script, you can just grab all the inputs and do whatever you like with them:
var inputs = document.getElementsByTagName('input');
for(var i = 0, len = inputs.length; i < len; i++) {
var input = inputs[i];
input.type = "text"; //etc...
}
Upvotes: 1