Skip to content

Commit

Permalink
Merge branch 'release/1.60.1' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoy committed Oct 19, 2023
2 parents 0f7e8ac + c761ed5 commit 729d023
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Configuration/AppStoreBuildNumber.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CURRENT_PROJECT_VERSION = 68
CURRENT_PROJECT_VERSION = 69
2 changes: 1 addition & 1 deletion Configuration/Version.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MARKETING_VERSION = 1.61.0
MARKETING_VERSION = 1.60.1
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/content-scope-scripts",
"state" : {
"revision" : "aa279a3b006a0b1e009707311283c7fcaed24fb7",
"version" : "4.39.0"
"revision" : "254b23cf292140498650421bb31fd05740f4579b",
"version" : "4.40.0"
}
},
{
Expand Down Expand Up @@ -129,7 +129,7 @@
{
"identity" : "trackerradarkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/TrackerRadarKit",
"location" : "https://github.com/duckduckgo/TrackerRadarKit.git",
"state" : {
"revision" : "4684440d03304e7638a2c8086895367e90987463",
"version" : "1.2.1"
Expand Down
14 changes: 12 additions & 2 deletions DuckDuckGo/Tab/Model/Tab+UIDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ extension Tab: WKUIDelegate, PrintingUserScriptDelegate {
windowFeatures: WKWindowFeatures,
completionHandler: @escaping (WKWebView?) -> Void) {

switch newWindowPolicy(for: navigationAction) {
switch newWindowPolicy(for: navigationAction, windowFeatures: windowFeatures) {
// popup kind is known, action doesn‘t require Popup Permission
case .allow(let targetKind):
// proceed to web view creation
Expand Down Expand Up @@ -123,7 +123,7 @@ extension Tab: WKUIDelegate, PrintingUserScriptDelegate {
}
}

private func newWindowPolicy(for navigationAction: WKNavigationAction) -> NavigationDecision? {
private func newWindowPolicy(for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> NavigationDecision? {
if let newWindowPolicy = self.decideNewWindowPolicy(for: navigationAction) {
return newWindowPolicy
}
Expand All @@ -134,6 +134,16 @@ extension Tab: WKUIDelegate, PrintingUserScriptDelegate {
return newWindowPolicy
}

// This is a temporary fix for macOS 14.1 WKWindowFeatures being empty when opening a new regular tab
// Instead of defaulting to no policy, we default to tab policy, and allow popups in some limited scenarios.
// See https://app.asana.com/0/1177771139624306/1205690527704551/f.
if #available(macOS 14.1, *) {
if windowFeatures.statusBarVisibility != nil || windowFeatures.menuBarVisibility != nil {
return nil
}
return .allow(.tab(selected: true, burner: burnerMode.isBurner))
}

// allow popups opened from an empty window console
let sourceUrl = navigationAction.safeSourceFrame?.safeRequest?.url ?? self.url ?? .empty
if sourceUrl.isEmpty || sourceUrl.scheme == URL.NavigationalScheme.about.rawValue {
Expand Down

0 comments on commit 729d023

Please sign in to comment.