Skip to content

Commit

Permalink
chore: omit URL from output 🔧
Browse files Browse the repository at this point in the history
  • Loading branch information
kentbetita committed Feb 22, 2024
1 parent 511504d commit 351892e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Sources/ActiveWinCLI/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,14 @@ func getWindowInformation(window: [String: Any], windowOwnerPID: pid_t) -> [Stri
"memoryUsage": window[kCGWindowMemoryUsage as String] as? Int ?? 0
]

// Only run the AppleScript if active window is a compatible browser.
if
let bundleIdentifier = app.bundleIdentifier,
let script = getActiveBrowserTabURLAppleScriptCommand(bundleIdentifier),
let url = runAppleScript(source: script)
{
output["url"] = url
// Run the AppleScript to get the URL if active window is a compatible browser and accessibility permissions are enabled.
if !disableAccessibilityPermission {
if let bundleIdentifier = app.bundleIdentifier,
let script = getActiveBrowserTabURLAppleScriptCommand(bundleIdentifier),
let url = runAppleScript(source: script)
{
output["url"] = url
}
}

return output
Expand Down

0 comments on commit 351892e

Please sign in to comment.