1. Tomas Beran
  2. PowerBuilder
  3. Wednesday, 27 April 2022 14:10 PM UTC

Hi

It looks like NavigationStart event is called when the webbrowser object is created (or drawn etc). Plus it seems to be called asynchronously because:

If there's no Navigate() called in Open event of the window then only this 'ghost' NavigationStart is triggered.

But in case there's Navigate() in Open event then at first my NavigationStart is called and then the mysterious Navigation start is triggered.

 

What events trigger NavigationStart? I thought only Navigate() and Refresh() should do it.

 

The DefaultURL property is empty.

PB 2021, build 1506.

Tomas Beran Accepted Answer Pending Moderation
  1. Thursday, 28 April 2022 09:42 AM UTC
  2. PowerBuilder
  3. # 1

Thank you, now it's clear. If there's no Navigate() in window Open event NavigationStart is triggered once and TitleTextChanged contains about:blank.

If there's Navigate() in the window open event NavigationStart is triggered twice and TitleTextChanged  contains a title of the loaded page.

I've added logging ability to my testing app. Now there's Navigate() called in the window open event. Events are called in this order:

Navigate(https://www.appeon.com)
NavigationStateChanged
NavigationStart
NavigationProgress 10
NavigationProgress 80
NavigationProgress 100
NavigationProgress 100
NavigationStateChanged
TitleTextChanged about:blank
NavigationStateChanged
NavigationStart
NavigationProgress 10
NavigationProgress 21
TitleTextChanged Rapidly Develop Cloud Apps Based on .NET Core with PowerBuilder | Appeon Website
NavigationProgress 27
NavigationProgress 28
NavigationProgress 80
NavigationProgress 100
NavigationProgress 100
NavigationStateChanged
TitleTextChanged Rapidly Develop Cloud Apps Based on .NET Core with PowerBuilder | Appeon Website

Attachments (1)
Comment
  1. Tomas Beran
  2. Thursday, 28 April 2022 10:15 AM UTC
But if the page is just a picture then the second NavigationStart event is missing:



Navigate(https://www.appeon.com/sites/default/files/home/homeR3_bg1.jpg?fid=1479)

NavigationStateChanged

NavigationStart

NavigationProgress 10

NavigationProgress 80

NavigationProgress 100

NavigationProgress 100

NavigationProgress 53

TitleTextChanged homeR3_bg1.jpg (2000×680)

NavigationProgress 100

NavigationProgress 100

NavigationStateChanged

TitleTextChanged homeR3_bg1.jpg (2000×680)
  1. Helpful
  1. Kai Zhao @Appeon
  2. Friday, 29 April 2022 01:48 AM UTC
Hi Tomas,

It’s not related to the picture. Actually, it’s related to the cache. Once you’ve accessed a website, when you access the resource of this website again, it’ll trigger the Navigationstart event in the open event only once. You can try accessing a picture of a website that you’ve never accessed before, it will also trigger it twice. For example:

https://demo.appeon.com/AWS/images/for-ios_storedownload.png

Regards,Kai

  1. Helpful
  1. Tomas Beran
  2. Friday, 29 April 2022 10:24 AM UTC
OK, I think I've found a solution for secure calling EvaluateJavascript (emulate missing 'navigated' event):

NavigationStateChanged followef by TitleTextChanged are always last event.



1. Check if Navigate was called

2. Navigation progress = 100

3. Title is not null, title is not empty and title is not "about:blank"

4. There was no error since Navigate() has been called.
  1. Helpful
There are no comments made yet.
Tomas Beran Accepted Answer Pending Moderation
  1. Thursday, 28 April 2022 08:44 AM UTC
  2. PowerBuilder
  3. # 2

Hi

If I understand well then only Navigate() and Refresh should fire NavigationStart event.

Triggering NavigationStart after Open() of the window which contains webbrowse object is a bug.

Is this correct?

The reason I'm asiking is I call RegisterEvent() in NavigationStart. And I've noticed NavigationStart is triggered twice. First at Window Open and second is my own Navigate with an actual URL.

I've attached a code which demonstrates NavigationStart triggering. The webbrowse object is empty with just a messagebox in its NavigationStart event.

Attachments (1)
Comment
  1. Kai Zhao @Appeon
  2. Thursday, 28 April 2022 08:53 AM UTC
Hi Tomas,

As I mentioned before, the default value of DefaultURL property is "about:blank", it will navigate to "about:blank" if there is no DefaultURL and no Navigate() called in Open event of the window, in this case, the NavigationStart event also been triggered , you can check titletext in titlechanged event.

https://docs.appeon.com/pb2021/objects_and_controls/DefaultUrl.html

Regards,Kai
  1. Helpful
There are no comments made yet.
Kai Zhao @Appeon Accepted Answer Pending Moderation
  1. Thursday, 28 April 2022 05:07 AM UTC
  2. PowerBuilder
  3. # 3

Hi Tomas,

Navigate() and Refresh() will trigger NavigationStart, and it can also be triggered when a web page jumps and refreshes within the site, such as a Google search.

Please note the default value of DefaultURL property is "about:blank" (when it is empty), which you can find in PowerBuilder help, so it will navigate to "about:blank" if there is no DefaultURL and no Navigate() called in Open event of the window.
https://docs.appeon.com/pb2021/objects_and_controls/DefaultUrl.html

Regards,
Kai

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.