Page 1 of 1
How to get the webbrowser address ?
Posted: Fri Jun 30, 2023 7:57 pm
by daviddeargentina
Hi all,
I'm new user and i'm testing the MiniBrowser sample, change a couple of actions and all works fine -yet-
I'm trying to get a variable with the clicked link on any webpage. program goes to the new location, but i can`t get the new url address.
Any ideas to solve this ?
Greetings from Buenos Aires, Argentina
Re: How to get the webbrowser address ?
Posted: Fri Jun 30, 2023 8:03 pm
by jassing
daviddeargentina wrote: Fri Jun 30, 2023 7:57 pm
I'm trying to get a variable with the clicked link on any webpage. program goes to the new location, but i can`t get the new url address.
From the help file for webgadget wrote:
GetGadgetText(): Get the current URL.
Re: How to get the webbrowser address ?
Posted: Fri Jun 30, 2023 8:22 pm
by daviddeargentina
Thanks a bunch!
Re: How to get the webbrowser address ?
Posted: Fri Jun 30, 2023 9:30 pm
by Kiffi
you can also use the NavigationCallback:
Code: Select all
Procedure NavigationCallback(Gadget, Url$)
Debug Url$
ProcedureReturn #True
EndProcedure
OpenWindow(0, 0, 0, 1000, 800, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
WebGadget(0, 0, 0, 1000, 800, "https://www.purebasic.com")
SetGadgetAttribute(0, #PB_Web_NavigationCallback, @NavigationCallback())
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
Re: How to get the webbrowser address ?
Posted: Mon Jul 03, 2023 6:22 pm
by daviddeargentina
very interesting alternative. thank you so much.
I'm still investigating:
if I change the url from purebasic.com to (for example)
https://maps.google.com/maps?z=10&t=m&q ... 5209230567
after a couple of seconds, google does not validate credentials and asks to change browser.
Is there a way to fix this?
Thanks again
David
Re: How to get the webbrowser address ?
Posted: Mon Jul 03, 2023 6:52 pm
by jassing
I don't know what the webgadget is based on, but like that it's just a simple browser, no ajax/javascript, etc.
Maybe use one of the chromium extensions? Probably have better luck with those.