From e41b0edf0a324958c0492e205839e2dc59fb5a2f Mon Sep 17 00:00:00 2001 From: David Rosca Date: Sat, 6 Jan 2018 20:01:07 +0100 Subject: [PATCH] Make qupzilla:restore working also with disabled JavaScript Instead of temporarily enabling JavaScript, make the page functional without it. --- src/lib/app/browserwindow.cpp | 3 --- src/lib/app/mainapplication.cpp | 4 --- src/lib/data/html/restore.html | 22 +++++++++++++-- .../schemehandlers/falkonschemehandler.cpp | 27 ++++++++++++++++++- .../schemehandlers/falkonschemehandler.h | 5 +++- 5 files changed, 50 insertions(+), 11 deletions(-) diff --git a/src/lib/app/browserwindow.cpp b/src/lib/app/browserwindow.cpp index e3916639b..41ec8cfda 100644 --- a/src/lib/app/browserwindow.cpp +++ b/src/lib/app/browserwindow.cpp @@ -275,9 +275,6 @@ void BrowserWindow::postLaunch() if (mApp->isStartingAfterCrash()) { addTab = false; startUrl.clear(); - // qupzilla:restore needs JavaScript enabled - // correct value is then restored in MainApplication::destroyRestoreManager - mApp->webSettings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true); m_tabWidget->addView(QUrl("falkon:restore"), Qz::NT_CleanSelectedTabAtTheEnd); } else if (mApp->afterLaunch() == MainApplication::SelectSession || mApp->afterLaunch() == MainApplication::RestoreSession) { diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index fd4c65f2f..117df947f 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -468,10 +468,6 @@ void MainApplication::destroyRestoreManager() return; } - // Restore JavaScript settings - const bool jsEnabled = Settings().value(QSL("Web-Browser-Settings/allowJavaScript"), true).toBool(); - m_webProfile->settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, jsEnabled); - delete m_restoreManager; m_restoreManager = 0; } diff --git a/src/lib/data/html/restore.html b/src/lib/data/html/restore.html index 01b12c8a5..d6998b286 100644 --- a/src/lib/data/html/restore.html +++ b/src/lib/data/html/restore.html @@ -120,6 +120,17 @@ li {padding: 5px;} vertical-align: top; } +#listview td.js-disabled +{ + text-align: center; + height: 150px; +} + +#listview tbody tr.js-disabled:hover +{ + background-color: transparent; +} +