aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Skec <skec@protonmail.ch>2020-12-26 16:55:43 +1100
committerFelix Queißner <felix@ib-queissner.de>2020-12-26 10:27:55 +0100
commit06b254d686a9fbed702e8d1777dc5c7adcba1fbe (patch)
tree30d7bc7a3aea933d24d54964b46147663341769b /src
parent865da65915f714c1473688d70878c00511e232f6 (diff)
downloadkristall-06b254d686a9fbed702e8d1777dc5c7adcba1fbe.tar.gz
Fix #79. Also added Ctrl+U shortcut for 'View page source'
Diffstat (limited to 'src')
-rw-r--r--src/browsertab.cpp9
-rw-r--r--src/browsertab.hpp2
-rw-r--r--src/mainwindow.ui3
3 files changed, 12 insertions, 2 deletions
diff --git a/src/browsertab.cpp b/src/browsertab.cpp
index 136a01f..1180f11 100644
--- a/src/browsertab.cpp
+++ b/src/browsertab.cpp
@@ -668,12 +668,19 @@ void BrowserTab::on_inputRequired(const QString &query, const bool is_sensitive)
}
}
-void BrowserTab::on_redirected(const QUrl &uri, bool is_permanent)
+void BrowserTab::on_redirected(QUrl uri, bool is_permanent)
{
Q_UNUSED(is_permanent);
this->network_timeout_timer.stop();
+ // #79: Handle non-full url redirects
+ if (uri.isRelative())
+ {
+ uri.setScheme(current_location.scheme());
+ uri.setHost(current_location.host());
+ }
+
if (redirection_count >= kristall::options.max_redirections)
{
setErrorMessage(QString("Too many consecutive redirections. The last redirection would have redirected you to:\r\n%1").arg(uri.toString(QUrl::FullyEncoded)));
diff --git a/src/browsertab.hpp b/src/browsertab.hpp
index 7ddd843..182e397 100644
--- a/src/browsertab.hpp
+++ b/src/browsertab.hpp
@@ -119,7 +119,7 @@ private: // network slots
void on_requestProgress(qint64 transferred);
void on_requestComplete(QByteArray const & data, QString const & mime);
- void on_redirected(QUrl const & uri, bool is_permanent);
+ void on_redirected(QUrl uri, bool is_permanent);
void on_inputRequired(QString const & user_query, bool is_sensitive);
void on_networkError(ProtocolHandler::NetworkError error, QString const & reason);
void on_certificateRequired(QString const & info);
diff --git a/src/mainwindow.ui b/src/mainwindow.ui
index a10ad4b..8bda9c5 100644
--- a/src/mainwindow.ui
+++ b/src/mainwindow.ui
@@ -406,6 +406,9 @@
<property name="text">
<string>View document source</string>
</property>
+ <property name="shortcut">
+ <string>Ctrl+U</string>
+ </property>
</action>
</widget>
<customwidgets>