For all I know, this is something that can't be fixed on the KM end, but I was wondering if @peternlewis could let us know the state of affairs with Brave Browser...? If the answer is, "nothing can be done", that's fine; I can start using a different browser. Just be nice to know.
A few things that haven't worked for a few months now:
Set/get tab number
Found image in Front Window
Wait for Brave Browser to Finish Loading
There are a bunch of actions I never use, so I can't confirm if they're working or not, but these three are enough to mean Brave isn't really usable with KM. There's a workaround for finding images in the front window, but it would be nice if it just worked.
Interesting. I tested them before posting to try to avert an egg-on-face moment but they definitely don't work. I'm on Monterey and Brave is up to date. Same for you?
As far as I recall, Brave does not support the requisite AppleScript abilities, and until that happens that actions cannot be implemented in Keyboard Maestro - you can potentially try to UI control Brave, but that is not something that could be done robustly enough to implement in the native actions.
tell application "Brave Browser"
get the active tab index of the front window
end tell
...and go to a tab by its number with:
tell application "Brave Browser"
set the active tab index of the front window to <Number>
end tell
I can wait till the current tab has finished loading with:
tell application "Brave Browser"
set TabNum to the active tab index of the front window
repeat until (loading of tab TabNum of window 1 is false)
end repeat
loading of tab TabNum of window 1
end tell
If KM relies on AS, and AS can do this, it seems odd that KM can't.
Based on this, and @vincent_ardern's confidence, perhaps something's wrong with my configuration.
I had a quick try yesterday using the "Front Browser Control" actions and Brave seemed OK. Perhaps try some of those instead (I guess you're using "Chrome Control" currently?) for another data point.
And once again, you save my bacon (never understood that expression!).
I wonder why the Brave-specific actions stopped working lately. Clearly something's amiss and I wonder if this might give us a clue how to get the front window stuff working again? It's a bit of a pain to have to do this every time you want to find an image in Brave:
For your example, do you mean the inability to constrain image detection to "Front Window"? I couldn't get that to work either (though I'm likely doing something wrong) although, weirdly, this does work:
I haven't a clue what the difference is between "Frontmost Window" in the action and "frontmost window of frontmost app" in the function -- but it appears there is one!
Dayumm.. I could have sworn I'd copied and pasted them. Either the Wiki's been updated, I copied them from a misquoted thread, or... A glitch in the Matrix?
You've fixed the Brave actions for me! Right, now about that found image thing...
That is weird. Simplifies things somewhat, at least.
I put you wrong sorry. I use the front browser actions, not the Chrome/Brave actions. I sometimes try to use Safari for a bit (hasn’t stuck yet), hence using front browser by default.
@peternlewis, the only missing piece of the puzzle is...
Keyboard Maestro clearly can search Brave's front window for images, so I'm wondering if there's a tweak that would make it work straight out of the box...?