PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: CWebCtx and timeout on navigate  (Read 306 times)

Paul Squires

  • Administrator
  • Master Member
  • *****
  • Posts: 8635
  • Windows 10
    • PlanetSquires Software
CWebCtx and timeout on navigate
« on: October 27, 2018, 11:19:16 AM »

Hi Jose,

I may not be using the control correctly so please forgive me if my understanding is wrong. I implemented the code into WinFBE and everything seemed to work well except that the first page loads would time out (returns a value of 1 indicating object failed to initialize until the timeout of 10 seconds). The second page load seemed to load after about 8 seconds or so. Subsequent pages loaded almost instantly until eventually I would click on another page to load and it would hang for a while again. Strange.

I ripped the code out of WinFBE and created a bare minimum test program in order to show you. Hopefully the same problem will show on your computer as well. The program is basically a Treeview that recursively loads HTML versions of all of your Markdown help files. Clicking on the Treeview nodes will load the name of the specified HTML file.

Can you shed some light on this? Should I be checking other properties of the browser control (busy state, initialization, etc).

(Code and exe attached in rar archive).

Thanks!
 
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Josť Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3109
    • Jos
Re: CWebCtx and timeout on navigate
« Reply #1 on: October 27, 2018, 12:10:37 PM »

I suspect that it is caused by the antivirus software (in my case Windows Defender).

« Last Edit: October 27, 2018, 12:17:19 PM by Josť Roca »
Logged

Paul Squires

  • Administrator
  • Master Member
  • *****
  • Posts: 8635
  • Windows 10
    • PlanetSquires Software
Re: CWebCtx and timeout on navigate
« Reply #2 on: October 27, 2018, 02:48:30 PM »

I suspect that it is caused by the antivirus software (in my case Windows Defender).

I also only use Windows Defender. I turned off all virus protect (real time, cloud based, etc) and the problem was still there. I'll try a few other things to see if it makes any difference.
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Josť Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3109
    • Jos
Re: CWebCtx and timeout on navigate
« Reply #3 on: October 27, 2018, 03:15:10 PM »

I don't know. If I save a web page, like this one, there is no delay.

Joerg Buckel

  • FireFly3 Registered User
  • Junior Member
  • *
  • Posts: 52
  • FF3 and WinFBE+WinFBX User
Re: CWebCtx and timeout on navigate
« Reply #4 on: October 28, 2018, 11:56:15 AM »

Hello Paul
I can confirm the problem.
I am using Kaspersky Internet Security.  Whether I quit the software or have it active makes no difference to me.
I wait up to 17 seconds for the content to be displayed.
Logged
Greeting from Germany

Joerg

Paul Squires

  • Administrator
  • Master Member
  • *****
  • Posts: 8635
  • Windows 10
    • PlanetSquires Software
Re: CWebCtx and timeout on navigate
« Reply #5 on: October 28, 2018, 12:54:37 PM »

Thanks Joerg, I appreciate you confirming the problem. I wonder if it is something in the generated HTML that is causing the slowdown because Jose points out that other HTML seems to work okay. Obviously I won't implement this type of help system into WinFBE if the wait times are this long.
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

SeaVipe

  • FireFly3 User
  • Junior Member
  • *
  • Posts: 129
  • Windows 10
Re: CWebCtx and timeout on navigate
« Reply #6 on: October 28, 2018, 03:14:32 PM »

Hi Paul,
Similar delay on my Windows 10, BitDefender machine.


Interesting that rapid, multiple clicks on the tree will eventually work and display the correct page but with an initial delay. To your code I added ? "a", ? "b" before every line of code (a through m). With multiple clicks on the tree, once the initial delay expired and all the pages rapidly displayed, the Console displayed as per the attached image.


It turns out the delay is at the end of the rapid clicks.


This is the line of code just after ? "k"
Code: [Select]
pwb->SetFocus
Logged
Clive Richey

SeaVipe

  • FireFly3 User
  • Junior Member
  • *
  • Posts: 129
  • Windows 10
Re: CWebCtx and timeout on navigate
« Reply #7 on: October 28, 2018, 04:51:30 PM »

Hi Paul,


Using different code (example code in WinFBX) I see that this HTML code has an impact on file load time:


Code: [Select]

  <!--[if lt IE 9]>
  <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
  <![endif]-->


The browser is being interpreted as IE9
Logged
Clive Richey

Paul Squires

  • Administrator
  • Master Member
  • *****
  • Posts: 8635
  • Windows 10
    • PlanetSquires Software
Re: CWebCtx and timeout on navigate
« Reply #8 on: October 28, 2018, 05:24:11 PM »

Hi Clive, great catch there buddy - thanks! Yes, it certainly does appear that could be the bottleneck. I downloaded the javascript code directly from https://github.com/aFarkas/html5shiv and put it in the same folder as the html file. I then modified the html file as follows and the loads were almost instantaneous.

  <!--[if lt IE 9]>
    <script src="html5shiv-printshiv.min.js"></script>
  <![endif]-->
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Paul Squires

  • Administrator
  • Master Member
  • *****
  • Posts: 8635
  • Windows 10
    • PlanetSquires Software
Re: CWebCtx and timeout on navigate
« Reply #9 on: October 28, 2018, 06:04:13 PM »

I updated my conversion tools to modify the html code to point to a local copy of the javascript file. I have attached a new rar archive with all of the new files. It appears to load very quickly now. Please let me know if it is also fast for you. Thanks!
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Josť Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3109
    • Jos
Re: CWebCtx and timeout on navigate
« Reply #10 on: October 28, 2018, 06:27:53 PM »

The solution seems to be:

To add

  <meta http-equiv='X-UA-Compatible' content='IE=edge' />
  <meta http-equiv='MSThemeCompatible' content='Yes'>

in the head section

and remove

  <!--[if lt IE 9]>
    <script src="html5shiv-printshiv.min.js"></script>
  <![endif]-->

Thanks to Microsofot infinite wisdom, the embedded WebBrowser control emulates IE 7.

Adding

  <meta http-equiv='X-UA-Compatible' content='IE=edge' />

to the web page forces to use the latest IE installed without emulating IE 7.

The purpose of the html5shiv-printshiv.min.js script is to add support for HMTL5 to older versions of IE by parsing the DOM and modifying it.

Paul Squires

  • Administrator
  • Master Member
  • *****
  • Posts: 8635
  • Windows 10
    • PlanetSquires Software
Re: CWebCtx and timeout on navigate
« Reply #11 on: October 28, 2018, 06:35:42 PM »

Wow, thanks Jose! I will pivot my course and update the html's using your code. That will be faster and cleaner than loading the javascript, etc.
:)
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

SeaVipe

  • FireFly3 User
  • Junior Member
  • *
  • Posts: 129
  • Windows 10
Re: CWebCtx and timeout on navigate
« Reply #12 on: October 28, 2018, 06:44:41 PM »

Paul, Your current version works very fast.

I'll look again after the next update.
Logged
Clive Richey

Paul Squires

  • Administrator
  • Master Member
  • *****
  • Posts: 8635
  • Windows 10
    • PlanetSquires Software
Re: CWebCtx and timeout on navigate
« Reply #13 on: October 28, 2018, 10:44:48 PM »

I have updated my tools to create html files based on Jose's suggestion to add the "X-UA-Compatible" meta tag. Seems to work very well and fast. I have attached the new files.
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Josť Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3109
    • Jos
Re: CWebCtx and timeout on navigate
« Reply #14 on: October 29, 2018, 06:32:10 AM »

It is very annoying that now that HTML5 is mainstream, the embedded WebBroser control still emulates IE 7. If we build the web page, we can use the meta tag workaround, but we are powerless when we load a web page from internet. In this case, the only thing that we can do is to modify a registry setting.
Pages: [1] 2