1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

[QupZillaPages] Always enable JavaScript for qupzilla: pages

Closes #1150
This commit is contained in:
nowrep 2014-01-20 12:46:39 +01:00
parent 354b9d1695
commit 36724df3a6

View File

@ -204,7 +204,10 @@ bool WebPage::isLoading() const
void WebPage::urlChanged(const QUrl &url)
{
Q_UNUSED(url)
// Make sure JavaScript is enabled for qupzilla pages regardless of user settings
if (url.scheme() == QLatin1String("qupzilla")) {
settings()->setAttribute(QWebSettings::JavascriptEnabled, true);
}
if (isLoading()) {
m_adBlockedEntries.clear();
@ -280,6 +283,12 @@ void WebPage::printFrame(QWebFrame* frame)
void WebPage::addJavaScriptObject()
{
// Make sure all other sites have JavaScript set by user preferences
// (JavaScript is enabled in WebPage::urlChanged)
if (url().scheme() != QLatin1String("qupzilla")) {
settings()->setAttribute(QWebSettings::JavascriptEnabled, mApp->webSettings()->testAttribute(QWebSettings::JavascriptEnabled));
}
if (url().toString() != QLatin1String("qupzilla:speeddial")) {
return;
}