tabWidgetPointer->currentWidget()->setFocus();
}
-PrivacyWebEngineView* TabWidget::addTab(const bool focusNewWebEngineView)
+PrivacyWebEngineView* TabWidget::addTab(const bool removeUrlLineEditFocus, const bool backgroundTab)
{
// Create a privacy WebEngine view.
PrivacyWebEngineView *privacyWebEngineViewPointer = new PrivacyWebEngineView();
// Populate the zoom factor. This is necessary if a URL is being loaded, like a local URL, that does not trigger `applyDomainSettings()`.
privacyWebEngineViewPointer->setZoomFactor(Settings::zoomFactor());
- // Move to the new tab.
- tabWidgetPointer->setCurrentIndex(newTabIndex);
+ // Move to the new tab if it is not a background tab.
+ if (!backgroundTab)
+ tabWidgetPointer->setCurrentIndex(newTabIndex);
// Clear the URL line edit focus so that it populates correctly when opening a new tab from the context menu.
- if (focusNewWebEngineView)
+ if (removeUrlLineEditFocus)
emit clearUrlLineEditFocus();
// Return the privacy WebEngine view pointer.