<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;"><br>
Hi Zoltan,<br>
<br>
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. <a href="https://en.m.wikipedia.org" target="_blank">
https://en.m.wikipedia.org</a> url.<br>
<br>
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.<br>
<br>
HTH,<br>
Raine<br>
<br>
<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF984176"><font face="Tahoma" size="2" color="#000000"><b>Lähettäjä:</b> devel-bounces@lists.sailfishos.org [devel-bounces@lists.sailfishos.org] käyttäjän Zoltán Lutor [zoltan.lutor@gmail.com] puolesta<br>
<b>Lähetetty:</b> 28. tammikuuta 2016 22:55<br>
<b>Vastaanottaja:</b> Sailfish OS Developers<br>
<b>Aihe:</b> [SailfishDevel] Webview and clicking on external link<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">Hi,
<div><br>
</div>
<div>Any idea how to open link clicked in webview in browser application?</div>
<div>Code below does not do the trick - rather opens link inside the webview itself...</div>
<div><br>
</div>
<div><a href="http://doc.qt.io/qt-5/qml-qtwebkit-webview.html#onNavigationRequested-signal" target="_blank">http://doc.qt.io/qt-5/qml-qtwebkit-webview.html#onNavigationRequested-signal</a><br>
</div>
<div><br>
</div>
<div>WebView<span style="color:rgb(192,192,192)"> </span>{<br>
</div>
<div>
<pre style="margin-top:0px; margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,0,0)">id</span>:<span style="color:rgb(192,192,192)"> </span><span style="font-style:italic; color:rgb(0,0,0)">webViewer</span></pre>
<pre style="margin-top:0px; margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,0,0)">anchors.fill</span>:<span style="color:rgb(192,192,192)"> </span><span style="font-style:italic; color:rgb(0,0,0)">parent</span></pre>
<pre style="margin-top:0px; margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span>onNavigationRequested<span style="color:rgb(192,192,192)"> </span>:<span style="color:rgb(192,192,192)"> </span>{</pre>
<pre style="margin-top:0px; margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span><span style="font-style:italic; color:rgb(0,85,175)">console</span>.debug(<span style="color:rgb(0,128,0)">"request.url:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"</span>,<span style="color:rgb(192,192,192)"> </span>request.url)</pre>
<pre style="margin-top:0px; margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span>(request.navigationType<span style="color:rgb(192,192,192)"> </span>===<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">WebView</span>.LinkClickedNavigation)<span style="color:rgb(192,192,192)"> </span>{</pre>
<pre style="margin-top:0px; margin-bottom:0px"><span style="color:rgb(192,192,192)">                </span>request.action<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">WebView</span>.IgnoreRequest</pre>
<pre style="margin-top:0px; margin-bottom:0px"><span style="color:rgb(192,192,192)">                </span><span style="font-style:italic; color:rgb(0,85,175)">Qt</span>.openUrlExternally(request.url)</pre>
<pre style="margin-top:0px; margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span>}</pre>
<pre style="margin-top:0px; margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span>}</pre>
<pre style="margin-top:0px; margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>}</pre>
<pre style="margin-top:0px; margin-bottom:0px"><br></pre>
<pre style="margin-top:0px; margin-bottom:0px">Thx,</pre>
<pre style="margin-top:0px; margin-bottom:0px"><br></pre>
<pre style="margin-top:0px; margin-bottom:0px">Zoltan</pre>
</div>
</div>
</div>
</div>
</div>
</body>
</html>