gtk3.webview component

Post

Posted
Rating:
#1 (In Topic #1313)
Regular
rj71 is in the usergroup ‘Regular’
 Hi All, Possibly silly question here! I have a project that I heavily use the gtk3.webview component. Is there a way to query or poll the webview componant to see the currently "loaded" URL? I see on the wiki the "URL" property Returns or sets the URL. I use that property to navigate to the webpage but Returns? Does that mean it can tell what URL it's at? Maybe I am misunderstanding what that means. I know I can just keep track of where the webview navigates to but that seems messy and could easily go wrong. Hoping there is just a simple way to query or poll it. Thanks!
Online now: No Back to the top

Post

Posted
Rating:
#2
Guru
BruceSteers is in the usergroup ‘Guru’
what's the url?

i just tried it and it works as expected.

Code (gambas)

  1.  
  2. Public Sub WebView1_DblClick()
  3.  
  4.   Debug WebView1.Url
  5.  
  6.  

the initial url is Google

Form1.WebView1_DblClick.34: Google

Then i clicked the "About" link and doubleclicked the view again
Form1.WebView1_DblClick.34: About Google: Our products, technology and company information - About Google

Some pages like for example the gambas home page at sourceforge https://gambas.sourceforge.net/en/main.html#
shows the web pages in an internal web container (iframe) so the main URL does not change, you will have to use Javascript to find the urls of the iframes
Online now: No Back to the top

Post

Posted
Rating:
#3
Regular
rj71 is in the usergroup ‘Regular’

BruceSteers said

what's the url?

i just tried it and it works as expected.

Code (gambas)

  1.  
  2. Public Sub WebView1_DblClick()
  3.  
  4.   Debug WebView1.Url
  5.  
  6.  

the initial url is Google

Form1.WebView1_DblClick.34: Google

Then i clicked the "About" link and doubleclicked the view again
Form1.WebView1_DblClick.34: About Google: Our products, technology and company information - About Google

Some pages like for example the gambas home page at sourceforge https://gambas.sourceforge.net/en/main.html#
shows the web pages in an internal web container (iframe) so the main URL does not change, you will have to use Javascript to find the urls of the iframes


I think I understand what you mean. I could use some JS to commicate to a DB or server with the current URL of the page in the webview. I was looking for a Gambas solution and it did not occur to me it could be done within the page itself. Thanks Bruce!
Online now: No Back to the top
1 guest and 0 members have just viewed this.