I am making an IE Addon using BandObjects in C#. I am making my web browser navigate to a page, suppose it's example.com. In that page there's an IFrame whose src is sub.example.com. So, IFrame points to a subdomain. I am able to fetch the URL of the IFrame, but unable to get the Page Source, when I view in the browser, it's there, but through code I can only view the script, no data. I am pasting the IFrame:
<iframe height="40" src="http://sub.example.com/....php?style=web&ext=1305964161&hash=Ng1gwLG821-f" frameBorder="0" width="300" scrolling="no"></iframe>
When I view this element through visual studio, in HTML view, it shows me the data, that's an email, and Text View shows this. How do I get开发者_如何学C the HTML view or say the Page Source if this Iframe. So, overall I want the data contained in this IFrame, the browser executes it some way, but how can I do it with code? I have visited lot of sites, forums, but couldn't get it to work.
Well in the browser thats active the code is what the code is, theres no way of viewing the source of a frame within the active window unless of course the frame is large enough to right click on and view the source of itself. Otherwise your stuck with whats rendered in the browser as your source and the iframe per say is irrelevant in a matter of speaking. However seeing as its an add-on your making is it possible to load the url of the iframe up in a hidden window of sorts and then obtain the code that way as you would for the active page? Can you use javascript anywhere in your addon? I know thats a silly question but Ive never built an addon for a browser.
if you can use javascript however maybe something like getting the iframe name/id/whatever to identify it and then using innerHTML on the element you might be able to catch the source.
精彩评论