browserInfo
Returns a fact about Safari, Chrome or the front browser: its name, its current URL, the page title and so on.
Keyboard Maestro: ChromeURL, SafariTitle, FrontBrowserURL
Details #
browserInfo(browser, field) takes exactly two arguments and returns text.
browser is "safari", "chrome" or "front" (the most recently front of the two). Any other value is treated as "front".
field is one of name, path, bundleID, version, longVersion (about the app), url, title (of the current tab in the front window), windowName or readyState (the page's document.readyState). Field names are not case-sensitive. An unknown field gives empty text.
Parameters #
Takes 2 arguments.
{{ browserInfo(text, b) }}
Examples #
browserInfo("front", "url")browserInfo("safari", "title")Gotchas #
Needs Automation permission for the browser. When the browser isn't running, can't be asked, or doesn't answer within about 4 seconds, you get empty text.
readyStateruns JavaScript in the page, so it also depends on the browser allowing that.