Hi Zoltan,

Your example snippet looks valid. There's no need for goExternal kind of 
functions. Only thing that I can image is that you're not actually clicking a 
link rather something that resembles link clicking from user point of view such 
as JavaScript/CSS highlighting + DOM manipulation without anchors element. Try 
your example with e.g. https://en.m.wikipedia.org url.

You might see linkHovered(string hoveredUrl, string hoveredTitle) signal being 
emitted. Maybe this could help you. You still need to have proper navigation 
ignoring code on navigationRequested signal handler.

HTH,
Raine


________________________________
Lähettäjä: devel-boun...@lists.sailfishos.org 
[devel-boun...@lists.sailfishos.org] käyttäjän Zoltán Lutor 
[zoltan.lu...@gmail.com] puolesta
Lähetetty: 28. tammikuuta 2016 22:55
Vastaanottaja: Sailfish OS Developers
Aihe: [SailfishDevel] Webview and clicking on external link

Hi,

Any idea how to open link clicked in webview in browser application?
Code below does not do the trick - rather opens link inside the webview 
itself...

http://doc.qt.io/qt-5/qml-qtwebkit-webview.html#onNavigationRequested-signal

WebView {

        id: webViewer

        anchors.fill: parent

        onNavigationRequested : {

            console.debug("request.url: ", request.url)

            if (request.navigationType === WebView.LinkClickedNavigation) {

                request.action = WebView.IgnoreRequest

                Qt.openUrlExternally(request.url)

            }

        }

    }


Thx,


Zoltan
_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Reply via email to