From 0938ae36f96e5240e3cc72ba1a288b8001150412 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 6 Jun 2013 17:22:58 +0200 Subject: Get sure JS is properly detected and executed --- src/urlbar/urlsuggester.cpp | 3 ++- src/webtab/protocolhandler.cpp | 2 +- src/webtab/webview.cpp | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/urlbar/urlsuggester.cpp b/src/urlbar/urlsuggester.cpp index d6aaaf52..0a775d85 100644 --- a/src/urlbar/urlsuggester.cpp +++ b/src/urlbar/urlsuggester.cpp @@ -78,7 +78,8 @@ UrlSuggester::UrlSuggester(const QString &typedUrl) if (_browseRegexp.isEmpty()) { QString protocol = QString("^(%1)").arg(KProtocolInfo::protocols().join("|")); - + protocol += QL1S("|javascript"); + QString localhost = QL1S("^localhost"); QString local = QL1S("^/"); diff --git a/src/webtab/protocolhandler.cpp b/src/webtab/protocolhandler.cpp index 2d5a36aa..4cf61be5 100644 --- a/src/webtab/protocolhandler.cpp +++ b/src/webtab/protocolhandler.cpp @@ -125,7 +125,7 @@ bool ProtocolHandler::preHandling(const QNetworkRequest &request, QWebFrame *fra // 11 is length of 'javascript:' // fromPercentEncoding() is used to decode all the % encoded // characters to normal, so that it is treated as valid javascript - scriptSource = QUrl::fromPercentEncoding(_url.url().mid(11).toAscii()); + scriptSource = QUrl::fromPercentEncoding(_url.url().mid(11).toUtf8()); if (scriptSource.isEmpty()) return false; } diff --git a/src/webtab/webview.cpp b/src/webtab/webview.cpp index ac46e9c4..5a4a597b 100644 --- a/src/webtab/webview.cpp +++ b/src/webtab/webview.cpp @@ -141,6 +141,7 @@ void WebView::load(const QNetworkRequest &req, QNetworkAccessManager::Operation { QNetworkRequest request = req; const QUrl &reqUrl = request.url(); + if (reqUrl.host() == url().host()) { request.setRawHeader(QByteArray("Referer"), url().toEncoded()); -- cgit v1.2.1