Browse the docs

safariIsComplete

Returns 1 when Safari has finished loading its current tab, otherwise 0.

Keyboard Maestro: SAFARIISCOMPLETE

Details #

safariIsComplete() takes no arguments and returns a number: 1 when the page in the current tab of the front window reports document.readyState as complete, 0 while it is still loading.

It asks Safari, so it runs a small piece of JavaScript in the tab.

Parameters #

Takes 0 arguments. {{ safariIsComplete() }}

Examples #

safariIsComplete()
→ 0

Gotchas #

  • Needs Automation permission for the browser (System Settings, Privacy & Security, Automation). Without it, or when the browser isn't running, the answer is 0.

  • A 0 also comes back when the tab can't be read, so it can't tell "still loading" from "no browser".

  • Passing an argument is an error: safariIsComplete() takes 0 arguments, got 1.