mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 09:32:12 +01:00
LocationBar: Use WebPage::supportedSchemes to find which schemes to load
This commit is contained in:
parent
e6601baf1f
commit
6241e8d37f
|
@ -283,12 +283,8 @@ LocationBar::LoadAction LocationBar::loadAction(const QString &text)
|
||||||
const bool forceLoad = guessedUrl.scheme() == QL1S("javascript");
|
const bool forceLoad = guessedUrl.scheme() == QL1S("javascript");
|
||||||
// Only allow spaces in query
|
// Only allow spaces in query
|
||||||
if (forceLoad || !QzTools::containsSpace(guessedUrl.toString(QUrl::RemoveQuery))) {
|
if (forceLoad || !QzTools::containsSpace(guessedUrl.toString(QUrl::RemoveQuery))) {
|
||||||
// Only allow whitelisted schemes
|
// Only allow supported schemes
|
||||||
static const QSet<QString> whitelistedSchemes = {
|
if (forceLoad || WebPage::supportedSchemes().contains(guessedUrl.scheme())) {
|
||||||
QSL("http"), QSL("https"), QSL("ftp"), QSL("file"),
|
|
||||||
QSL("data"), QSL("about"), QSL("falkon")
|
|
||||||
};
|
|
||||||
if (forceLoad || whitelistedSchemes.contains(guessedUrl.scheme())) {
|
|
||||||
action.type = LoadAction::Url;
|
action.type = LoadAction::Url;
|
||||||
action.loadRequest = guessedUrl;
|
action.loadRequest = guessedUrl;
|
||||||
return action;
|
return action;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user