mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 18:56:34 +01:00
Fixed blocking link with ftp and qupzilla schemes because of the 'Same Origin Policy'.
This commit is contained in:
parent
709bc71f1a
commit
dd58127293
@ -56,7 +56,6 @@
|
|||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
#include <QFileOpenEvent>
|
#include <QFileOpenEvent>
|
||||||
#endif
|
#endif
|
||||||
#include <QWebSecurityOrigin>
|
|
||||||
#include <QNetworkDiskCache>
|
#include <QNetworkDiskCache>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
@ -413,10 +412,6 @@ void MainApplication::loadSettings()
|
|||||||
m_websettings->setWebGraphic(QWebSettings::DefaultFrameIconGraphic, qIconProvider->emptyWebIcon().pixmap(16, 16));
|
m_websettings->setWebGraphic(QWebSettings::DefaultFrameIconGraphic, qIconProvider->emptyWebIcon().pixmap(16, 16));
|
||||||
m_websettings->setWebGraphic(QWebSettings::MissingImageGraphic, QPixmap());
|
m_websettings->setWebGraphic(QWebSettings::MissingImageGraphic, QPixmap());
|
||||||
|
|
||||||
// Allows to load files from qrc: scheme in qupzilla: pages
|
|
||||||
QWebSecurityOrigin::addLocalScheme("qupzilla");
|
|
||||||
QWebSecurityOrigin::addLocalScheme("ftp");
|
|
||||||
|
|
||||||
if (m_isPrivateSession) {
|
if (m_isPrivateSession) {
|
||||||
m_websettings->setAttribute(QWebSettings::PrivateBrowsingEnabled, true);
|
m_websettings->setAttribute(QWebSettings::PrivateBrowsingEnabled, true);
|
||||||
history()->setSaving(false);
|
history()->setSaving(false);
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include "iconprovider.h"
|
#include "iconprovider.h"
|
||||||
#include "mainapplication.h"
|
#include "mainapplication.h"
|
||||||
|
|
||||||
|
#include <QWebSecurityOrigin>
|
||||||
#include <QFileIconProvider>
|
#include <QFileIconProvider>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
@ -202,6 +203,7 @@ void FtpSchemeReply::loadPage()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QWebSecurityOrigin::addLocalScheme("ftp");
|
||||||
open(ReadOnly | Unbuffered);
|
open(ReadOnly | Unbuffered);
|
||||||
QTextStream stream(&m_buffer);
|
QTextStream stream(&m_buffer);
|
||||||
stream.setCodec("UTF-8");
|
stream.setCodec("UTF-8");
|
||||||
@ -220,6 +222,7 @@ void FtpSchemeReply::loadPage()
|
|||||||
emit readyRead();
|
emit readyRead();
|
||||||
emit finished();
|
emit finished();
|
||||||
m_ftp->close();
|
m_ftp->close();
|
||||||
|
QWebSecurityOrigin::removeLocalScheme("ftp");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString FtpSchemeReply::loadDirectory()
|
QString FtpSchemeReply::loadDirectory()
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
#include <QWebSecurityOrigin>
|
||||||
|
|
||||||
static QString authorString(const char* name, const QString &mail)
|
static QString authorString(const char* name, const QString &mail)
|
||||||
{
|
{
|
||||||
@ -78,6 +79,7 @@ QupZillaSchemeReply::QupZillaSchemeReply(const QNetworkRequest &req, QObject* pa
|
|||||||
|
|
||||||
void QupZillaSchemeReply::loadPage()
|
void QupZillaSchemeReply::loadPage()
|
||||||
{
|
{
|
||||||
|
QWebSecurityOrigin::addLocalScheme("qupzilla");
|
||||||
QTextStream stream(&m_buffer);
|
QTextStream stream(&m_buffer);
|
||||||
stream.setCodec("UTF-8");
|
stream.setCodec("UTF-8");
|
||||||
|
|
||||||
@ -112,6 +114,7 @@ void QupZillaSchemeReply::loadPage()
|
|||||||
|
|
||||||
emit readyRead();
|
emit readyRead();
|
||||||
emit finished();
|
emit finished();
|
||||||
|
QWebSecurityOrigin::removeLocalScheme("qupzilla");
|
||||||
}
|
}
|
||||||
|
|
||||||
void QupZillaSchemeReply::delayedFinish()
|
void QupZillaSchemeReply::delayedFinish()
|
||||||
|
Loading…
Reference in New Issue
Block a user