Skip to content

Commit

Permalink
Only trigger JS Navigation if not WatchInYoutube
Browse files Browse the repository at this point in the history
  • Loading branch information
afterxleep committed Oct 14, 2024
1 parent 5dd2f22 commit 44bd50e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion DuckDuckGo/DuckPlayer/DuckPlayerNavigationHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,11 @@ extension DuckPlayerNavigationHandler: DuckPlayerNavigationHandling {
// Assume JS Navigation is user-triggered
self.navigationType = .linkActivated

handleURLChange(url: url, webView: webView)
// Only handle URL changes if the allowFirstVideo is set to false
// This prevents Youtube redirects from triggering DuckPlayer when is not expected
if !duckPlayer.settings.allowFirstVideo {
handleURLChange(url: url, webView: webView)
}
}

@MainActor
Expand Down

0 comments on commit 44bd50e

Please sign in to comment.