Safari 10.11.5 KM Actions & Tokens Not Working -- How To Fix

Since a lot of people will presumably be updating to OS X 10.11.5 soon, and since Apple has idiotically disabled AppleScript’s ability to control JavaScript by default in Safari on 10.11.5, if you use any of Keyboard Maestro’s Safari actions or conditions or tokens, you will need to disable this "security feature" (I say security feature in quotes since anything on your Mac that can run an AppleScript already has the ability to destroy all your data, so stopping it from using JavaScript in your browser seems to be the most pointless of security theatre).

So to return the Safari actions to working order, you must:

  • Enable the Develop menu in Safari if not already enabled in Safari’s Advanced preferences.
  • Enable Allow JavaScript from Apple Events in the Develop menu.
4 Likes

I have a macro which ran into this. I was writing an email when I saw this posted. In terms of user-facing actions, it doesn't use AppleScript or JavaScript, just the Open URL action, which I presume is a Safari action triggering the error. So, in short, I'm posting this just in case it falls outside the parameters of what you thought could trigger this "security feature."

Right, it is the Safari actions, which work by AppleScript control of Safari, and often by execute JavaScript in the browser window via AppleScript requests to Safari.

In this case, it is the Safari action Wait For Safari to Finish Loading, which is querying the completion state of the browser window by using AppleScript to talk to Safari to ask it to execute JavaScript, which is blocked by the new security feature.

I am going to just quit using safari. This is all too complicated. Groan

Hey @Ellenm

Chrome is worse. Seriously.

These two steps are eay to follow:

  1. Enable the Develop menu in Safari if not already enabled in Safari’s Advanced preferences.
  • Enable Allow JavaScript from Apple Events in the Develop menu.

-Chris

Perhaps there aren't any programmers left there ?

( Could be why they seem puzzled, now, about what an Esc key is for ... )

I have enabled the Developers Menu.
I see the Enable Allow JavaScript from Apple Events in the Develop menu
But when i click it, it does not turn on. I get a dialog, i choose Allow, but after that there is no checkmark. On my other machine it does, but not on my laptop.

What can i do?

EDIT: I have it working now. I have no idea why though. I had another website open, checked the menu again. Now i had to fill in my admin password and now it is checked. Vague.

1 Like