Launch bookmarklet or Javascript in frontmost browser?

Hi all. I have a Javascript bookmarklet that changes some colors on web pages that I use a lot in different browsers.

I'd like to be able to use the keyboard to trigger the bookmarklet, or execute the Javascript it contains, in the current tab of the frontmost browser, whatever browser I'm using.

Any suggestions? Thanks!

You can use Execute a JavaScript in Front Browser action.
However you may need to edit the JavaScript somewhat.

The JIB works only for Safari, Google Chrome, and Chrome-based browsers.

For what it's worth, I use a browser add-on that does this automatically on page load. It might be useful for you?

I'd be interested in the browser add-on, but my biggest problem is that they usually only work in one or two browsers. When I'm working, I often have Safari, Chrome, Brave and Firefox going all at once; I'd prefer to have the same tool in all of them...

You can use the KM Action in all but Firefox:

1 Like

If Bookmarks/Favorites are accessible through menus in all the browsers (like they are in Safari), then the Keyboard Maestro action to Select Or Show A Menu Item can be used to launch bookmarklets.

image

If so, Macro Groups for each browser would make it possible to have the same Keyboard Maestro trigger no matter which browser is being used.

1 Like

Not for me, and not even via “click found image”. On both I get “must enable JavaScript via apple events in developer menu”. Which im afraid to do, unsure of security risks : p

Fairly standard to enable that - applescripts can only be launched by a user with the relevant permissions