Welcome Guest Search | Active Topics | Sign In | Register

RedirectLocation to file:/// failure Options
zs949
Posted: Friday, January 22, 2016 4:21:48 AM
Rank: Newbie
Groups: Member

Joined: 1/4/2016
Posts: 4
//Custom Resource handler
internal class ResourceRedirectLocation333 : ResourceHandler
{
public const string SampleUrlPrefix = "https://www.google.com";

public const string EmbeddedPageUrl0 = "https://www.yahoo.com";
public const string EmbeddedPageUrl1 = "https://www.google.com";
public const string EmbeddedPageUrl2 = "file:///E:/Web/Main/index.html";

public override bool Match(Request request)
{
return request.Url.StartsWith(SampleUrlPrefix, StringComparison.OrdinalIgnoreCase);
}

public override void ProcessRequest(Request request, Response response)
{
response.RedirectLocation = EmbeddedPageUrl0;
response.StatusCode = 302;
response.End();
}
}

when i set response.RedirectLocation = EmbeddedPageUrl0, it is worked.
but when i set response.RedirectLocation = EmbeddedPageUrl1, or =EmbeddedPageUrl2 , it is failure!

so, response.RedirectLocation can be set to file:/// ?

thx!
eo_support
Posted: Friday, January 22, 2016 11:31:15 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

This is normal. You can not redirect from an Internet Url to a local file Url. All major browser, including Google Chrome browser, impose this restrictions. Since EO.WebBrowser is based on Google Chrome's source code, you can not do that either.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.