I want to obtain the text of an iframe in Google Chrome using Javascript. (I will pass this text using a chrome extension to a google app engine application, which will then do processing using the data received). Also, can you also tell me how to encode this into JSON format and send this data as part of a call to external web application? (Although if you can only tell me how to obtain body text that will also b开发者_C百科e good enough for me :) )
I have done similar work in my extension. I just put this
document.body.innerHTML
in my contentscript.js, and this is part of my manifest.json
"content_scripts" : [
{
"matches" : [
"http://*/*",
"https://*/*"
],
"js" : ["contentscript.js"],
"run_at" : "document_idle",
"all_frames" : true
}
],
精彩评论