Skip to content

Commit

Permalink
Add macOS URL support for more browsers (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
wrgoto authored Apr 9, 2021
1 parent c300839 commit b8efe5a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Sources/active-win/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import AppKit

func getActiveBrowserTabURLAppleScriptCommand(_ appName: String) -> String? {
switch appName {
case "Google Chrome", "Brave Browser", "Microsoft Edge":
case "Google Chrome", "Google Chrome Beta", "Google Chrome Dev", "Google Chrome Canary", "Brave Browser", "Brave Browser Beta", "Brave Browser Nightly", "Microsoft Edge", "Microsoft Edge Beta", "Microsoft Edge Dev", "Microsoft Edge Canary", "Sidekick", "Opera":
return "tell app \"\(appName)\" to get the URL of active tab of front window"
case "Safari":
return "tell app \"Safari\" to get URL of front document"
Expand Down
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ declare namespace activeWindow {
owner: MacOSOwner;

/**
URL of the active browser tab if the active window is Safari, Chrome, Edge, or Brave.
URL of the active browser tab if the active window is Safari, Chrome (includes Beta, Dev, and Canary), Edge (includes Beta, Dev, and Canary), Brave (includes Beta and Nightly), Sidekick, or Opera.
*/
url?: string;
}
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Returns a `Promise<object>` with the result, or `Promise<undefined>` if there is
- `processId` *(number)* - Process identifier
- `bundleId` *(string)* - Bundle identifier *(macOS only)*
- `path` *(string)* - Path to the app
- `url` *(string?)* - URL of the active browser tab if the active window is Safari, Chrome, Edge, or Brave *(macOS only)*
- `url` *(string?)* - URL of the active browser tab if the active window is Safari, Chrome (includes Beta, Dev, and Canary), Edge (includes Beta, Dev, and Canary), Brave (includes Beta and Nightly), Sidekick, or Opera *(macOS only)*
- `memoryUsage` *(number)* - Memory usage by the window owner process

## OS support
Expand Down

0 comments on commit b8efe5a

Please sign in to comment.