diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index 8eaf9f3f1..2801561f3 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -882,10 +882,7 @@ RegisterQAppAssociation* MainApplication::associationManager() QUrl MainApplication::userStyleSheet(const QString &filePath) const { - // Set default white background for all sites - // Fixes issue with dark themes when sites don't set background - QString userStyle = "html{background-color:white;}"; - userStyle += AdBlockManager::instance()->elementHidingRules() + "{ display:none !important;}"; + QString userStyle = AdBlockManager::instance()->elementHidingRules() + "{ display:none !important;}"; QFile file(filePath); if (!filePath.isEmpty() && file.open(QFile::ReadOnly)) { diff --git a/src/lib/webview/webtab.cpp b/src/lib/webview/webtab.cpp index bbf91ecce..233b5de2c 100644 --- a/src/lib/webview/webtab.cpp +++ b/src/lib/webview/webtab.cpp @@ -74,6 +74,11 @@ WebTab::WebTab(QupZilla* mainClass, LocationBar* locationBar) , m_pinned(false) , m_inspectorVisible(false) { + setObjectName("webtab"); + + // This fixes background of pages with dark themes + setStyleSheet("#webtab {background-color:white;}"); + m_layout = new QVBoxLayout(this); m_layout->setContentsMargins(0, 0, 0, 0); m_layout->setSpacing(0);