Results 1 to 8 of 8

Thread: [Help]VB6 + Webbrowser + Iframes + Different Domains]

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2009
    Posts
    5

    [Help]VB6 + Webbrowser + Iframes + Different Domains]

    1 - The Situation:
    I'm Using "Visual Basic 6"
    I'm Using "Webbrowser Control"
    I'm Using "Microsoft HTML Object Library"

    ====================================================

    2 - What I Want:
    *Acees objects (buttons, links, etc) on a IFRAME
    *Get all links for example, click in links, etc...

    This is easy... but...

    ===================================================

    3- THE PROBLEM:
    The page A is in www.abc.com
    The page B is in www.xyz.com
    The Page A contains one iframe to page B
    I Can't acess elements in Iframes with diferrent domains using normal methods.

    ====================================================

    4 - Example:

    PAGE A.html (www.abc.com/PageA.html) ==>
    <html>
    <body>
    THIS IS THE PAGE A!<Br>
    PAGE A contains one Iframe to PAGE B!<br>
    <Iframe id="PageB" name="PageB" src="http://www.xyz.com/PageB.html">
    </body>
    </html>

    ====================================================

    For example, if a try to get links of page B (iframe) pufff...
    "{"Access Denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"}"

    ====================================================

    5 - The phrase for the more experienced are:

    Nothing is impossible! you know!
    How can I then perform this procedure?

    Thanks

    ====================================================

  2. #2
    Frenzied Member
    Join Date
    Mar 2009
    Posts
    1,182

    Re: [Help]VB6 + Webbrowser + Iframes + Different Domains]

    Without an actual url to follow so we can test our possible solutions against it...

    Who knows?

    Good Luck
    Option Explicit should not be an Option!

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2009
    Posts
    5

    Re: [Help]VB6 + Webbrowser + Iframes + Different Domains]

    Create in your Pc ==> PAGE A.HTML

    Put This ==>

    <html>
    <body>
    THIS IS THE PAGE A!<Br>
    PAGE A contains one Iframe to PAGE B!<br>
    <Iframe id="PageB" name="PageB" src="http://www.google.com/">
    </body>
    </html>

    RUN PAGE A.HTML in your Webbrowser Control...

    Now, Acess This Frame and Make one Serch in Google ^^
    You can't do it =/

  4. #4
    Frenzied Member
    Join Date
    Mar 2009
    Posts
    1,182

    Re: [Help]VB6 + Webbrowser + Iframes + Different Domains]

    Okay, here is a start for you...
    Code:
    Option Explicit
    
    Private Sub Form_Load()
    WB.navigate "C:\a\test.htm"
    DoEvents
    End Sub
    
    Private Sub Command1_Click()
    
    Dim H As HTMLDocument
    Dim C As Object, S As Object
    Set H = WB.document
    
    Set C = H.getElementsByTagName("iframe")
    
    For Each S In C
      Debug.Print S.src
    Next S
    
    
    End Sub
    Good Luck
    Option Explicit should not be an Option!

  5. #5

    Thread Starter
    New Member
    Join Date
    Jun 2009
    Posts
    5

    Re: [Help]VB6 + Webbrowser + Iframes + Different Domains]

    Thanks for your reply... but... its DON'T WORK
    =/

  6. #6

    Thread Starter
    New Member
    Join Date
    Jun 2009
    Posts
    5

    Re: [Help]VB6 + Webbrowser + Iframes + Different Domains]

    Remenber, the iframe is in another domain.
    Is not possible to acess with normal methods, because this is Cross-Scripting, and is not possible without XSS Vulnerabilitys or especial procedures...

    ¬¬

    For Example
    1 - Navigate to any page with ADSENSE Banners...
    2 - Make one function to Click in one of the Links...

    Site is one domain, and adsense is in another domain, u CAN'T acess this iframe with normal methods... Try it please...

    Thanks.

  7. #7
    Frenzied Member
    Join Date
    Mar 2009
    Posts
    1,182

    Re: [Help]VB6 + Webbrowser + Iframes + Different Domains]

    Did you test my little snippit? Did you get the URL? Can you navigate to that URL?
    Option Explicit should not be an Option!

  8. #8

    Thread Starter
    New Member
    Join Date
    Jun 2009
    Posts
    5

    Re: [Help]VB6 + Webbrowser + Iframes + Different Domains]

    Yes man, I tested the code... still not working =/

    Please.... Try This:
    1 - Navigate to any page with Google ADSENSE Banners...
    2 - Make one function to Click in one of the Adsense Links.
    ==>You can see: if u try it, u recive de ACCESS DENIED =/

    If you have any progress, please post.

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width