mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 17:17:58 +02:00
Merge pull request #10160 from vladest/tabletwebview-yahoo-fix
Yahoo, Reddit etc now works correctly
This commit is contained in:
commit
aa89903a9f
2 changed files with 14 additions and 7 deletions
|
@ -104,6 +104,7 @@ Item {
|
||||||
|
|
||||||
// Required to support clicking on "hifi://" links
|
// Required to support clicking on "hifi://" links
|
||||||
if (WebEngineView.LoadStartedStatus == loadRequest.status) {
|
if (WebEngineView.LoadStartedStatus == loadRequest.status) {
|
||||||
|
urlAppend(loadRequest.url.toString())
|
||||||
var url = loadRequest.url.toString();
|
var url = loadRequest.url.toString();
|
||||||
if (urlHandler.canHandleUrl(url)) {
|
if (urlHandler.canHandleUrl(url)) {
|
||||||
if (urlHandler.handleUrl(url)) {
|
if (urlHandler.handleUrl(url)) {
|
||||||
|
@ -113,12 +114,6 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onNavigationRequested: {
|
|
||||||
if (request.navigationType == WebEngineNavigationRequest.LinkClickedNavigation) {
|
|
||||||
pagesModel.append({webUrl: request.url.toString()})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onNewViewRequested: {
|
onNewViewRequested: {
|
||||||
request.openIn(webView);
|
request.openIn(webView);
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,7 +117,7 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
function gotoPage(url) {
|
function gotoPage(url) {
|
||||||
pagesModel.append({webUrl: url})
|
urlAppend(url)
|
||||||
}
|
}
|
||||||
|
|
||||||
function reloadPage() {
|
function reloadPage() {
|
||||||
|
@ -126,9 +126,20 @@ Item {
|
||||||
view.setEnabled(true);
|
view.setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function urlAppend(url) {
|
||||||
|
var lurl = decodeURIComponent(url)
|
||||||
|
if (lurl[lurl.length - 1] !== "/")
|
||||||
|
lurl = lurl + "/"
|
||||||
|
if (currentPage === -1 || pagesModel.get(currentPage).webUrl !== lurl) {
|
||||||
|
pagesModel.append({webUrl: lurl})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onCurrentPageChanged: {
|
onCurrentPageChanged: {
|
||||||
if (currentPage >= 0 && currentPage < pagesModel.count && loader.item !== null) {
|
if (currentPage >= 0 && currentPage < pagesModel.count && loader.item !== null) {
|
||||||
loader.item.url = pagesModel.get(currentPage).webUrl
|
loader.item.url = pagesModel.get(currentPage).webUrl
|
||||||
|
web.url = loader.item.url
|
||||||
|
web.address = loader.item.url
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,6 +171,7 @@ Item {
|
||||||
if (currentPage >= 0) {
|
if (currentPage >= 0) {
|
||||||
//we got something to load already
|
//we got something to load already
|
||||||
item.url = pagesModel.get(currentPage).webUrl
|
item.url = pagesModel.get(currentPage).webUrl
|
||||||
|
web.address = loader.item.url
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue