Welcome Guest Search | Active Topics | Sign In | Register

View Source displaying nothing on EO Web Browser Options
Akansha
Posted: Sunday, March 29, 2020 6:25:45 PM
Rank: Newbie
Groups: Member

Joined: 3/21/2020
Posts: 9
Hi Team,

I am using EO Web Browser in WPF application, where I am making a user control of EO borwser which is then used in a window form.
When I am right clicking and tring to View Source, it opens a blank notepad file. It does not has any content.

I have seen your team has mentioned in some blogs to use below code-
string html = (string)webView1.EvalScript("document.documentElement.outerHTML");

But Even if we use this code in C# file and get the Html content in a variable, how can we link this variable to the action of "View Source" button (that appears on right click of EO Web Browser page).

I also wanted to know if there is any direct method that can show the content directly on click of View Source.

I have already shared a sample project in my previous Query request, you can use it for reference if required.

Kindly let us know the solution to above problem asap, since we are quite in a hurry to implement the feature.

Thanks.
eo_support
Posted: Tuesday, March 31, 2020 5:22:41 PM
Rank: Administration
Groups: Administration

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

It's normal that you may get blank contents when you use "View Source" even thought there are contents currently in the WebView. A web page's "source" and it's current contents are two different things. For example, the source of a web page can be JavaScript code that dynamically loads 100 images from the server. In this case the source is the JavaScript code and the 100 images are the current contents. You can You can:

1. Get the source of the WebView through WebView.GetSource method;
2. Get the current contents of the WebView by calling WebView.GetHtml method;
3. Handle the WebView's Command event when "View Source" menu item is clicked. Inside your event handler you can display whatever contents you wish to display and set e.Handled to true to prevent the default handling code to be called;

Hope this helps.

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.