I am working with the Dropbox API and I am noticing that I am not seeing the redirect URL in the DocumentComplete nor the CancelLoad events until and only after I force a reload using javascript.
Does this sound right meaning why do I have to force a reload to see the proper Redirect URL?
So not even to a file, hmmm
What are you getting back for a HTTP Status? Poking at the HTML Viewer docs (as if I haven’t been neck deep in them for the last two weeks) there’s no way to access the headers, perhaps something is coming in via DocumentProgressChanged? Or maybe even Error o.O
I’m not even looking at the Dropbox API right now, so take all my suggestions as if they were total guesses…
Also, isn’t the dropbox auth supposed to open in a web browser? I can’t recall from the last time I needed to auth something, but I thought that’s how it worked.
[quote=162362:@Tim Parnell]So not even to a file, hmmm
What are you getting back for a HTTP Status? Poking at the HTML Viewer docs (as if I haven’t been neck deep in them for the last two weeks) there’s no way to access the headers, perhaps something is coming in via DocumentProgressChanged? Or maybe even Error o.O
I’m not even looking at the Dropbox API right now, so take all my suggestions as if they were total guesses…
Also, isn’t the dropbox auth supposed to open in a web browser? I can’t recall from the last time I needed to auth something, but I thought that’s how it worked.[/quote]
Ill check the error event as that didn’t yield me anything last night, but I will double check. HTMLViewer is enough of a browser to pass the interaction as it is working well, minus the need for the reload for my to catch the Token/Bearer/UID. Once I get this I use the api.dropbox.com to interface via HTTPSecureSocket to finish the oAuth2.0 process.
No dice on the DocumentProgressChanged event. It shows the same URL that I loaded w/ the viewer. The same as the DocumentComplete, until I reload it then I get the redirected URL which contains what I need. I can make a work around, but I figured I’d as to see how to address this cleanly first.
This issue appears to be a Xojo HTMLViewer issue. I can attach a sample project if Greg or Norman could lend a hand to confirm for me please? I’d be happy to open a feedback case but I don’t want to waste anyone’s time if there is still something to do. Thanks again!
Ok I have changed the title of this question. I really only need to understand how I can obtain the URL that is present within HTMLViewer. I am messing with javascript but I am not having luck yet.
No matter what the HTMLViewer using R2.1 under Mac always returns the Original URL when I need the redirected URL. You simply right click on HTMLViewer and reload. It THEN shows the correct Redirected URL.
I catch the “redirected site’s title” and force a reload of the page to get the proper Redirected URL in the DocumentComplete event.
TitleChanged Event
if newTitle = "Google" AND siteCounter = 0 Then
HTMLViewer1.ExecuteJavaScript("location.reload();")
siteCounter = siteCounter + 1
end if
TitleChanged Event
if newTitle = “Google” AND siteCounter = 0 Then
HTMLViewer1.ExecuteJavaScript(“location.reload();”)
siteCounter = siteCounter + 1
end if
This is the code that forces the reload after I land on the Redirected URI. Only after this reload is when the DocumentCompleted event fires with the correct Redirected URL ie. with my access token.
[quote=162834:@Mike Cotrone]TitleChanged Event
if newTitle = “Google” AND siteCounter = 0 Then
HTMLViewer1.ExecuteJavaScript(“location.reload();”)
siteCounter = siteCounter + 1
end if
This is the code that forces the reload after I land on the Redirected URI. Only after this reload is when the DocumentCompleted event fires with the correct Redirected URL ie. with my access token. :)[/quote]
Jepp - theses lines do the magic. And solve one of my major problems. THANK YOU!