Click Safari Link Fails

I've had a macro that's clicking a link in my own web page (served locally), which has worked fine for years on my old computer (up to Mojave).

On a new Monterey system, same macro, same web page, this action no longer works (nothing happens).

It's just a standard weblink, nothing fancy in the page, and nothing has changed in this regard from when it used to work.

(Had to remove some tags from this link to show it here, but it's just a regular a link):-
a href='mypage.php?x=15&y=1049'>Create new article in this issue

When I click on the "Safari" popup in the click safari link action, it displays "No links found" (but it does find links when other tabs are selected so it is reading the page contents OK).

Safari Develop -> Allow JS from Apple Events is ticked.

Any troubleshooting tips I can try? There are plenty of "click safari link" posts here but none of them seem to give me a solution.

I've no idea why this no longer works...

  • Make sure your macro is actually working.
  • Recreate the click link action.
  • Try creating other click link actions.

Toggle this off and back on again:

Thanks for looking at this. This behaviour still occurs in a test macro with just that one Click Safari Link step, and none of the steps you list make a difference to this behaviour.

For some reason, KM just isn't parsing the web page and finding any HTML links - but it is finding links on other web pages.

The Chrome version of the same action also finds no links.

I'll do some more testing to see if I can find the cause of this behaviour, as it has always worked on my old Intel Mac on the same page...

Can you post the (suitably redacted! No "confidential" info...) HTML source? I'm wondering if there's a frame or similar involved.

Ok, it seems the source of the problem was linking in the Twitter widgets.js as described in their API docs - as soon as that call was made, KM no longer can read any links within a page. It seems to break something as far as KM is concerned.

I think it's a parsing thing, as the link started with two forward slashes which looks suspicious. (Not sure offhand whether that was something I did, or copied the link from somewhere like that!)

So easy enough workaround...

Nige_S - no, just a simple test html page, with one link in the body, and loading the Twitter widgets script is enough to stop KM finding the link.

Remove the Twitter script, and it works fine.

From the manual: " Note that all links visible on the web page may not be visible to Keyboard Maestro if the web page uses Frames or JavaScript or other tricks to display it."

And since "By default, widgets-js will find markup in a page and convert basic, functional mark-up into rich interactive widgets." -- it looks like you're hosed unless there's some way to tell widgets-js to ignore certain things.

No, as I explained above, that wasn't the issue, it was a parsing issue with the URL on that Twitter widgets.js call.

With that fixed, KM reads links in the page just fine, whether the Twitter script is included or not.

Thanks for the sounding board everyone, the issue is solved.