Internet Explorer Control Replacement Webview2

This forum is meant for anything you would like to share with other visitors
User avatar
ArneOrtlinghaus
Posts: 412
Joined: Tue Nov 10, 2015 7:48 am
Location: Italy

Internet Explorer Control Replacement Webview2

Post by ArneOrtlinghaus »

Hi Wolfgang,

thank you. I have tested yout sample program on my Windows 10 20H2 machine with the new Edge.
I had to install the 90 MB installation program "MicrosoftEdgeWebView2RuntimeInstallerX64.exe" on my machine ( https://docs.microsoft.com/en-us/micros ... stribution)

Afterwards the XSharp-Internet page was displayed in your sample program. It took quite a long time until the page was visible, but it worked.

Let's see how everything evolves. Probably we will need to move to the new control still this year or next year with the VO GUI, if Microsoft blocks more old functions. Currently this does not seem so. I tried to disable and to uninstall Internet Explorer from my computer and in both cases the Internet Explorer Control still worked.
Arne
FFF
Posts: 1581
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Internet Explorer Control Replacement Webview2

Post by FFF »

Hi Arne,
re "long time", i retried and running from Xide i have to wait about 2 sec. for display. Interestingly, the control seems to have some "private life": i changed the uri to point to my own site and got a warning, that the certificate wouldn't point to the uri. I accepted, and since then it opens the account's configuration form, located at my provider. Strange...
PS: If i remove the "s" from "https", my site opens quite normal ;)
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
User avatar
wriedmann
Posts: 3757
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Internet Explorer Control Replacement Webview2

Post by wriedmann »

Hi Arne,
I don't think Microsoft will remove the Internet Explorer Control from Windows - there are too many applications out that need it. Microsoft would be in trouble with many very large customers....
The other side is problematic: it will not take a long time until no more web pages support Internet Explorer.
Therefore the possibility to integrate Edge very easily is long overdue - and this possibility will be another advantage for the Windows platform.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
ArneOrtlinghaus
Posts: 412
Joined: Tue Nov 10, 2015 7:48 am
Location: Italy

Internet Explorer Control Replacement Webview2

Post by ArneOrtlinghaus »

Yes, right. It is the security situation that give us often problems for certain installations apart from the fact that certain Internet pages do not work correctly.

Microsoft will only deliver possibilities to block Internet Explorer and will only try to convince admins to use these blocks.

Arne
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Internet Explorer Control Replacement Webview2

Post by ic2 »

Hello Arne, Wolfgang,

Thank you very much for bringing this to my attention. I couldn't find source in Wolfgangs zip project, probably I missed something, but from https://developer.microsoft.com/en-us/m ... ad-section I created a WPF project which works. And with this code I can actually assign any html to the component which could finally make this WebView2 an alternative to show our mails in a up to date component instead of the old IE based html components, I hope.

public MainWindow()
{
InitializeComponent();
InitializeAsync();
}

async void InitializeAsync()
{
await webView.EnsureCoreWebView2Async(null);
string ctext = File.ReadAllText(@"c:tempTestHtmlVanMail.htm");
webView.NavigateToString(ctext);
}

Three more remarks, I came across while working on this:

1 According to the MS Documentation, Webview2 works when you have the Edge Chromium version or the runtime installed. Wolfgangs sample exe only shows the X# page when the runtime is installed. Deinstalling it and install Edge (Chromium) which I didn't install yet makes the program show empty screen again (besides the Ok and Cancel buttons)

2 In the same documentation a WPF .Net Core project is the sample selection. But this I don't see with the same search key as in the picture. I can only chose WPF .Net or WPF .Net Framework. Not sure if the first actually is .Net Core, they have the same description. Or else why I can't select a .Net Core project.

3 I found that .NetCore/5 doesn't support WCF. Great. So it means I should stay away from .Net5 as long as possible and also that again I invested time in a technology MS has chosen to deprecate. The alternative is apparently gRPC but as this is again from Microsoft (and Google) I think it's better not to spend time on it because in a few years they will no doubt deprecate that too.

Dick
User avatar
wriedmann
Posts: 3757
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Internet Explorer Control Replacement Webview2

Post by wriedmann »

Hi Dick,
my post contained both the source and the binaries - but the source was in the form of a VIAEF file. That is the export format for XIDE, ideal for such small samples.
I prefer using XIDE and plain source code because it shows the important things better - there are only 3 small prg files, two of them very small (the Start and the App module), and the last one the real form.
I have added them for purpose here:
WebView2.zip
(1.87 KiB) Downloaded 63 times
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
ArneOrtlinghaus
Posts: 412
Joined: Tue Nov 10, 2015 7:48 am
Location: Italy

Internet Explorer Control Replacement Webview2

Post by ArneOrtlinghaus »

Hi Dick,
I had to install the runtime that I mentioned above. It wasn't sufficient to have Edge installed. But it seems a bit difficult to find exact information.

Arne
User avatar
wriedmann
Posts: 3757
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Internet Explorer Control Replacement Webview2

Post by wriedmann »

Hi Dick,
regarding WCF: it seems that WCF in .NET Core 3.0 is not supported yet, but will be supported in the future in a community based project.
Microsoft simply seems to have too many constructions sites open at the same time....
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Internet Explorer Control Replacement Webview2

Post by ic2 »

Hello Arne,
ArneOrtlinghaus wrote:Hi Dick,
I had to install the runtime that I mentioned above. It wasn't sufficient to have Edge installed. But it seems a bit difficult to find exact information.
Indeed. There's something else I need to solve. The webbrower we now use for displaying a mail's content is from the so called nbit control, and it's clearly old IE stuff. If I click a URL in a mail, often I get heaps of script errors. If I Shift click an URL it always opens in IE instead of my default browser, Firefox.

Unfortunately, the Webview2 is also not using Firefox with a Shift click. It seems to open Edge Webview2 (not even regular Edge). I'll have to figure out if that is changeable. Probably I can do something with the ICoreWebView2NavigationStartingEventArgs interface .

Dick
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Internet Explorer Control Replacement Webview2

Post by ic2 »

Hello Wolfgang,

You can see that Xide is not y daily editor, didn't know about VIAEF files.
And about WCF, I have read there is an OpenSource project which is emulating WCF in .Net Core but not completely. Given that while building it even a tiny thing could lead to hours of searching why it failed I doubt that I should trust it. I think I I better change my WCF code to a more general communication concept which is not from Microsoft and which still works 10 years from now. MS can not be trusted to be future proof. Indeed they start all kind of things but they never finish anything properly.

Dick
Post Reply