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

JavaScript privacy options, update, part2

This commit is contained in:
Mladen Pejaković 2012-12-28 19:54:34 +01:00
parent 03d5b48538
commit bba5d3680d
3 changed files with 13 additions and 1 deletions

View File

@ -46,6 +46,10 @@ void QzSettings::loadSettings()
loadTabsOnActivation = settings.value("LoadTabsOnActivation", false).toBool(); loadTabsOnActivation = settings.value("LoadTabsOnActivation", false).toBool();
autoOpenProtocols = settings.value("AutomaticallyOpenProtocols", QStringList()).toStringList(); autoOpenProtocols = settings.value("AutomaticallyOpenProtocols", QStringList()).toStringList();
blockedProtocols = settings.value("BlockOpeningProtocols", QStringList()).toStringList(); blockedProtocols = settings.value("BlockOpeningProtocols", QStringList()).toStringList();
allowJsGeometryChange = settings.value("allowJavaScriptGeometryChange", false).toBool();
allowJsHideMenuBar = settings.value("allowJavaScriptHideMenuBar", false).toBool();
allowJsHideStatusBar = settings.value("allowJavaScriptHideStatusBar", false).toBool();
allowJsHideToolBar = settings.value("allowJavaScriptHideToolBar", false).toBool();
settings.endGroup(); settings.endGroup();
settings.beginGroup("Browser-Tabs-Settings"); settings.beginGroup("Browser-Tabs-Settings");

View File

@ -47,6 +47,10 @@ public:
// Web-Browser-Settings // Web-Browser-Settings
int defaultZoom; int defaultZoom;
bool loadTabsOnActivation; bool loadTabsOnActivation;
bool allowJsGeometryChange;
bool allowJsHideMenuBar;
bool allowJsHideStatusBar;
bool allowJsHideToolBar;
QStringList autoOpenProtocols; QStringList autoOpenProtocols;
QStringList blockedProtocols; QStringList blockedProtocols;

View File

@ -21,6 +21,7 @@
#include "qupzilla.h" #include "qupzilla.h"
#include "tabwidget.h" #include "tabwidget.h"
#include "tabbedwebview.h" #include "tabbedwebview.h"
#include "qzsettings.h"
#include <QTimer> #include <QTimer>
#include <QStatusBar> #include <QStatusBar>
@ -56,7 +57,7 @@ PopupWebPage::PopupWebPage(QWebPage::WebWindowType type, QupZilla* mainClass)
void PopupWebPage::slotGeometryChangeRequested(const QRect &rect) void PopupWebPage::slotGeometryChangeRequested(const QRect &rect)
{ {
if (rect.isValid()) { if (rect.isValid() && qzSettings->allowJsGeometryChange) {
m_geometry = rect; m_geometry = rect;
m_createNewWindow = true; m_createNewWindow = true;
} }
@ -64,16 +65,19 @@ void PopupWebPage::slotGeometryChangeRequested(const QRect &rect)
void PopupWebPage::slotMenuBarVisibilityChangeRequested(bool visible) void PopupWebPage::slotMenuBarVisibilityChangeRequested(bool visible)
{ {
if (!qzSettings->allowJsHideMenuBar) return;
m_menuBarVisible = visible; m_menuBarVisible = visible;
} }
void PopupWebPage::slotStatusBarVisibilityChangeRequested(bool visible) void PopupWebPage::slotStatusBarVisibilityChangeRequested(bool visible)
{ {
if (!qzSettings->allowJsHideStatusBar) return;
m_statusBarVisible = visible; m_statusBarVisible = visible;
} }
void PopupWebPage::slotToolBarVisibilityChangeRequested(bool visible) void PopupWebPage::slotToolBarVisibilityChangeRequested(bool visible)
{ {
if (!qzSettings->allowJsHideToolBar) return;
m_toolBarVisible = visible; m_toolBarVisible = visible;
} }