From 8a8f641298aff53fccfd06d3e3d939260a2a2055 Mon Sep 17 00:00:00 2001 From: Daniel Bernal Date: Thu, 19 Dec 2024 18:22:49 +0100 Subject: [PATCH] =?UTF-8?q?DuckPlayer:=20Don=E2=80=99t=20open=20new=20tabs?= =?UTF-8?q?=20or=20DuckPlayer=20at=20launch=20when=20in=20alwaysAsk=20mode?= =?UTF-8?q?=20(#3738)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task/Issue URL: https://app.asana.com/0/1204099484721401/1208896356321073/f Tech Design URL: CC: **Description**: Bugfix: When launching the app after a crash or force close with DuckPlayer in 'Ask' mode, the app automatically opened `youtube.com/watch` pages (videos) in DuckPlayer when it shouldn't. This was caused by DuckPlayer's 'open in new tab' feature. When the app was first launched, a new tab opened for every `youtube.com/watch` page, which triggered DuckPlayer by default. --- DuckDuckGo/DuckPlayer/DuckPlayerNavigationHandler.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DuckDuckGo/DuckPlayer/DuckPlayerNavigationHandler.swift b/DuckDuckGo/DuckPlayer/DuckPlayerNavigationHandler.swift index 13afd90eb0..8ea855cfca 100644 --- a/DuckDuckGo/DuckPlayer/DuckPlayerNavigationHandler.swift +++ b/DuckDuckGo/DuckPlayer/DuckPlayerNavigationHandler.swift @@ -954,7 +954,7 @@ extension DuckPlayerNavigationHandler: DuckPlayerNavigationHandling { // Redirect to Youtube + DuckPlayer Overlay if Ask Mode if url.isYoutubeWatch && duckPlayerMode == .alwaysAsk && !isDuckPlayerRedirect(url: url) { - redirectToYouTubeVideo(url: url, webView: webView, allowFirstVideo: false) + redirectToYouTubeVideo(url: url, webView: webView, allowFirstVideo: false, disableNewTab: true) return true }