llelectronics / webcat

WebCat is a Webkit based webbrowser for sailfish os
19 stars 13 forks source link

Targeted, relative links doesn't work #5

Closed Eccenux closed 10 years ago

Eccenux commented 10 years ago

If a page contains a link with target that moves to another tab and relative link then the browser will make a google search. Effectively it will try to treat href as full URL which it's not.

An example link opens google search with the text "dir/":

<a target="_blank" href="dir/" >dir/</a>

You can see a live example here: http://m.enux.pl/

A minimized test case: http://f.enux.pl/jolla/link-test/

Note that inside "dir" all links start with "../" (e.g. href="../dir/"). This also creates some weired behavior... A blank page appears with no URL in the address bar.

When fixing also keep in mind that there is a <base> tag. So you might want to resolve links through WebKit (e.g. read element.href) rather then appending string of current page as a prefix.

llelectronics commented 10 years ago

I cannot reproduce this on the mentioned pages. No error messages appear. It opens all the links as it should. Did you try the latest git version or which version you tested that with?

Eccenux commented 10 years ago

No, I didn't use devel version. I only tested with the one installed from Jolla shop. I just tried reinstalling, but that didn't change anything. When clicking on any link in "_blank" section all links open in new page and google search is shown.

I do have changed default browser to Dolphin if that is somehow important. But all links are opened in Webcat, so I don't think it's relevant.

llelectronics commented 10 years ago

The current version in Jolla Shop was updated two days ago(approve by Jolla actually as the update itself is a week old) and should fix that issue. (version 0.8-5) If it doesn't please try the current git version. Each _blank page should open in a new tab and on this link: http://f.enux.pl/jolla/link-test/ every link from the _blank section is opened up in a new tab showing the same page as the source but with a different url.