|
Rank: Advanced Member Groups: Member
Joined: 2/11/2015 Posts: 122
|
I've been dealing with a problem which I now believe may be a bug in EO's web browser, brought on by the latest Chromium update to 81. I use a custom scheme to redirect resources under certain conditions, we allow an application and certain file types associated with our software to provide a standard web url with our custom scheme, lets call the scheme example. I was able to reproduce this problem in the TabbedBrowser_CS sample provided with EO Total 2020 I added the following resource handler to the project
Code: C#
using EO.WebBrowser;
using System;
namespace EO.TabbedBrowser
{
public class ExampleResourceHandler : ResourceHandler
{
public sealed override bool Match(Request request) =>
request.Url.StartsWith("example", StringComparison.OrdinalIgnoreCase)
|| request.Url.StartsWith("examples", StringComparison.OrdinalIgnoreCase);
public override void ProcessRequest(Request request, Response response)
{
var uri = new Uri(request.Url);
response.StatusCode = 301;
response.RedirectLocation = $"http://{uri.Host}{uri.PathAndQuery}";
}
}
}
In the WebViewItem.cs file in the WebPage constructor I call
Code: C#
m_WebView.RegisterResourceHandler(new ExampleResourceHandler());
In App.xaml.cs I change
Code: C#
EO.WebEngine.EngineOptions.Default.RegisterCustomSchemes("sample");
to
Code: C#
EO.WebEngine.EngineOptions.Default.RegisterCustomSchemes("sample", "example", "examples");
Now if you launch the application, you can surf to any site, for example http://www.essentialobjects.com/ you'll load as expected. If you now go into the Debug UI and open up the Chromium debugger console and enter:
Code: JavaScript
window.location = 'example://www.google.com'
the page will redirect to about:blank#blocked and the custom ResourceHandler will never be processed, neither the Match nor ProcessRequest methods get executed. If you modify the following by removing "example" and "examples" the ResourceHandler will once again get processed, the behavior appears to be the inverse of what is expected.
Code: C#
EO.WebEngine.EngineOptions.Default.RegisterCustomSchemes("sample", "example", "examples");
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
We have confirmed this to be an issue. We will fix this in our next build and reply here again as soon as the new build is available.
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 2/11/2015 Posts: 122
|
Thank you for the update look forward to the patch, new update seems good overall.
|
|
Rank: Advanced Member Groups: Member
Joined: 2/11/2015 Posts: 122
|
Is there an ETA on when a patch for this will be available, we need these features and the PDF package we bought does not appear to provide the desired functionality in our current production version. This means this bug is a blocking issue for us to use EO.PDF since we cannot break our protocol schemes to make pdf printing available. This is also blocking a fix for an issue causing our software to crash via EO on Windows 7 machines.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
We have already fixed this issue internally. Our next update is scheduled at the end of the second week in September (around 11th). Will that work for you?
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 2/11/2015 Posts: 122
|
This works for us as long as this date doesn't extend far past the 11th, we have a good number of users negatively impacted by these issues and want to get them resolved as soon as we can.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
This is just to let you know that we have posted a new build (20.2.63) that should resolve this issue. You can download the new build from our download page.
Note that the custom scheme registration only affects navigation initialized on the render side (for example, running JavaScript code to set window.location). It has no impact on navigation initialized on the browser side (such as setting WebView.Url in C#). All schemes are always allowed on the browser side (as long as a custom handler exists).
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 2/11/2015 Posts: 122
|
In the latest update you've marked RegisterCustomSchemes as obsolete, is there anything that needs to be done differently now? I did notice that not registering custom schemes before the bug was fixed would allow my custom schemes to work, is that just the expected behavior now?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
Nothing particular different except that you no longer need to call RegisterCustomSchemes. In the latest version custom scheme would work as long as you have a custom resource handler. If neither custom resource handler nor the built-in handler handles it, then LaunchUrl event will be called (for top level Urls).
Thanks!
|
|