Is there any CocoaMessage magic I could possibly use to intercept/prevent WebGadget navigation when the user clicks a link?
Code: Select all
; This example does display the PureBasic.com website. Inside the callback procedure
; the navigation to the 'News' site will be avoided (#False returned), but allowed
; for all other sites (#True returned).
Procedure NavigationCallback(Gadget, Url$)
If Url$= "http://www.purebasic.com/news.php"
MessageRequester("", "No news today!")
ProcedureReturn #False
Else
ProcedureReturn #True
EndIf
EndProcedure
If OpenWindow(0, 0, 0, 600, 300, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
WebGadget(0, 10, 10, 580, 280, "http://www.purebasic.com")
SetGadgetAttribute(0, #PB_Web_NavigationCallback, @NavigationCallback())
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
I am looking to intercept links to certain filetypes and open them in a different part of my program.
Thanks!