Skip to content

Commit

Permalink
DuckPlayer: Don’t open new tabs or DuckPlayer at launch when in alway…
Browse files Browse the repository at this point in the history
…sAsk mode (#3738)

<!--
Note: This checklist is a reminder of our shared engineering
expectations. Feel free to change it, although assigning a GitHub
reviewer and the items in bold are required.

⚠️ If you're an external contributor, please file an issue first before
working on a PR, as we can't guarantee that we will accept your changes
if they haven't been discussed ahead of time. Thanks!
-->

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.
  • Loading branch information
afterxleep authored Dec 19, 2024
1 parent cdeddba commit 8a8f641
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DuckDuckGo/DuckPlayer/DuckPlayerNavigationHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 8a8f641

Please sign in to comment.