开发者

Can I access the content of an iframe in JavaScript that is part of a Google Chrome extension?

开发者 https://www.devze.com 2023-04-02 21:56 出处:网络
I have an iframe within the main window named \"test_ifram开发者_高级运维e\". I want to access the content of \"test_iframe\" within a Google Chrome extension. I understand that I can do this if I hav

I have an iframe within the main window named "test_ifram开发者_高级运维e". I want to access the content of "test_iframe" within a Google Chrome extension. I understand that I can do this if I have requisite permissions given in manifest.json.

Can I access the content of this iframe from a background HTML page? Or can I access it in a content script which is part of that extension? (In the latter case I suppose I have to pass the iframe content from the content script to a background page as part of a message for further processing(?))


Let's say this test_iframe comes from http://frame.example.com. I would just inject a content script directly to frame.example.com (instead of the parent page) and do everything there.

0

精彩评论

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