Reputation: 2632
Setup
I'm working on a project in which 4 WebBrowser controls are navigating to some webpage simultaneously when the application is loaded. The webpages have the same HTML, but are coming from different web servers.
The problem is that some of those pages display a "Navigation to the webpage was canceled" message in the WebBrowser control. This only happens when the application starts. I have implemented the solution described here to get the status code returned and weirdly enough, it is a 200 = OK status.
When I then refresh the page, it suddenly works correctly. I have suspicions that the problem might be caused by the simultaneous navigations, but I have no idea how I could verify that.
Any ideas?
Upvotes: 7
Views: 9695
Reputation: 2830
A case of Facebook Login using OAuth:
It worked for me navigating from WPF WebBrowser to:
https://graph.facebook.com/oauth/authorize?client_id=zzzzzzzzzzzzzzzz&redirect_uri=https://www.facebook.com/connect/login_success.html&type=user_agent&display=popup
Than something changed and I get: Navigation to the webpage was cancelled
From Chrome I can see the reason:
{
"error": {
"message": "Can't load URL: The domain of this URL isn't included in the app's domains. To be able to load this URL, add all domains and sub-domains of your app to the App Domains field in your app settings.",
"type": "OAuthException",
"code": 191,
"fbtrace_id": "GuhAfeO/85U"
}
}
Why happened?
The link above works only for empty "Valid OAuth Redirect URIs". When a URL was added to support a website login, the app stopped working.
I went to my settings and removed the url. Works now! https://developers.facebook.com/apps/zzzzzzzzzzzzzz/fb-login/settings/
Upvotes: 0
Reputation: 2632
Alright, so I ended up firing a navigation and waiting for it to complete before doing the next one and I haven't encountered the problem since. It was a problem that didn't need a fancy solution, and we didn't have time to dig deeper, so we went with that.
Upvotes: 3