开发者

javascript code to obtain body text of a web page in a specified iframe in Google Chrome web browser

开发者 https://www.devze.com 2023-04-01 03:25 出处:网络
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 da

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
}

],

0

精彩评论

暂无评论...
验证码 换一张
取 消