Fix open in browser on enter

This patch fixes the opening of the current item in a browser which
was broken for a long time.
This commit is contained in:
Jeena 2020-06-13 00:20:46 +02:00
parent 0bb19eae06
commit 4b804873a6
2 changed files with 9 additions and 6 deletions

View file

@ -81,11 +81,13 @@
function checkKey(e) {
e = e || window.event;
if (e.keyCode === 37) {
window.location.href = "feedthemonkey:previous";
}
else if (e.keyCode === 39) {
} else if (e.keyCode === 39) {
window.location.href = "feedthemonkey:next";
} else if(e.keyCode == 13) {
window.location.href = "feedthemonkey:open";
}
}

View file

@ -86,13 +86,14 @@ Item {
onNavigationRequested: {
if (request.url == "feedthemonkey:previous") {
// This is commented out because for some reason this reloads the page forever.
// This will show the error that the feedthemonkey:previous location is not supported
//request.action = WebEngineNavigationRequest.IgnoreRequest;
request.action = WebEngineView.IgnoreRequest;
app.showPreviousPost();
} else if (request.url == "feedthemonkey:next") {
//request.action = WebEngineNavigationRequest.IgnoreRequest;
request.action = WebEngineView.IgnoreRequest;
app.showNextPost();
} else if (request.url == "feedthemonkey:open") {
request.action = WebEngineView.IgnoreRequest;
Qt.openUrlExternally(post.link)
} else if (request.navigationType !== WebEngineNavigationRequest.LinkClickedNavigation) {
request.action = WebEngineView.AcceptRequest;
} else {