Safari Back Button Weirdness

I have a simple Kensington mouse with two side buttons for navigating forward and back in Safari. I uninstalled the Kensington software long ago to allow KM to control it.

I made a very simple macro to check if the History>Back menu was available, and if so, trigger it. The trigger is set to the mouse button using a USB device trigger.

Here's the weird part: if the pointer is over an image when I trigger the "back button," instead of firing the macro, it will open the underlying image in a new tab.

I double-checked, and I don't have any driver software or control panels running at the same time.

Any ideas? Here is the macro:

Tell me what happens if you AREN'T over an image when you press that button. That is, just when your mouse is over a non-clickable part of the page. That could be a big clue.

Also, tell me what happens if you are over a clickable link when you press that button.

I have a theory, but tell me the answers to those questions first. And right now I'm too tired to test this on my own mouse. I apologize for being tired.

P.S. Your macro probably doesn't need the IF statement. You just need the SELECT action, but you should turn off the error flags on the action so it doesn't report any errors.

It works as intended. If the History>Back menu is available, KM will trigger the menu and Safari will go back a page.

Interesting -- it opens the previous page in another tab.

How does this fit with your theory?

There're two ideas I have. First, since your symptoms are consistent with "COMMAND-CLICK" (or even COMMAND-MENU-ITEM, which I'll bet you never tried !!!) then this could mean either your macro or your mouse is holding the CTRL button for some reason when the menu command is selected. Try this - replace the Menu command with "Type a Keystroke" using "COMMAND-[" (which is the Safari shortcut for that menu item) as the key instead. If this fixes it, we have another clue. It will probably work around your problem, if nothing else.

Another idea I have, which I didn't want to test earlier, is whether this command is running both your macro and the button at the same time. (Some people call this "not eating your keystroke" or in this case, mouse click.) One way to test this is to turn off your macro, then press the mouse button to see what happens. If nothing happens, this isn't the cause of the problem. But if something happens, we have a new clue. I still don't want to test this because my mouse is likely a different model than yours, so testing my mouse doesn't necessarily fix your problem.

I feel like I'm only 70% likely to be able to solve your problem. But that's better than 0%.

P.S. I always love using the word "There're." It's so hilarious. :laughing: It makes me sound like a pirate.

Thanks for explaining.

@ccstone suggested that I change the menu condition from name to path, and that fixed it.

No idea why it was opening tabs, but this put a stop to it. (Thanks, Chris!)

Well, 98% of his ideas correct, so that's great. I'm only around 80%. However I think if you had tried my "Type a Keystroke" idea that would have fixed it also.