Search code examples
c#iframewebbrowser-controlgeckofx

How to get iframe address in geckofx?


How do I get same information about iframe like in browser properties when you right-click the element but programmatically? I need Address and Referring URL.

iframe properties


Solution

  • you can get the frame by name of by tag name (both return a collection and require indexer or linq).

    From there, you can access the properties, e.g. Src is the url for the frame.

    GeckoFrameElement frame = this.Document.GetElementsByTagName("frame")[0] as GeckoFrameElement;
    var address =  frame.Src;