Skip to content

Commit

Permalink
Merge pull request #731 from quoid/feat/do-not-open-safari-when-chang…
Browse files Browse the repository at this point in the history
…e-save-location

feat(macos): do not open safari when change save location
  • Loading branch information
ACTCD authored Sep 28, 2024
2 parents c38c3a3 + 16bbb3d commit c4a57a7
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions xcode/App-Mac/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,16 @@ class ViewController: NSViewController {
// update user interface text display
self.saveLocation.stringValue = url.absoluteString
self.saveLocation.toolTip = url.absoluteString
// notify browser extension of relevant updates
sendExtensionMessage(
name: "SAVE_LOCATION_CHANGED",
userInfo: [
"saveLocation": url.absoluteString.removingPercentEncoding ?? url.absoluteString,
"returnApp": true
]
)
// notify browser extension of relevant updates only when Safari is running
if !NSRunningApplication.runningApplications(withBundleIdentifier: "com.apple.Safari").isEmpty {
sendExtensionMessage(
name: "SAVE_LOCATION_CHANGED",
userInfo: [
"saveLocation": url.absoluteString.removingPercentEncoding ?? url.absoluteString,
"returnApp": true
]
)
}
})
}

Expand Down

0 comments on commit c4a57a7

Please sign in to comment.