Keyboard Maestro provides a large set of web browser actions that work with Safari and Google Chrome, but require each browser to be set to accept their input as described below.
These actions work only with those two browsers (and optionally, their developer versions, Safari Technology Preview and Chrome Canary) because they are the only two web browsers that have comprehensive AppleScript support.
The actions can work with the Front Browser, which really means the most recently front web browser of Safari or Google Chrome.
You can change the targeted browser in the gear ⚙ menu.
For the Safari actions to work, you must enable Allow JavaScript for Apple Events. To do so, first enable the Develop menu in the Safari preferences, and then ensure the Allow JavaScript for Apple Events option is ticked in the Develop menu.
For the Chrome actions to work, you must enable Allow JavaScript from Apple Events. To do so, click on View, and then ensure that in the Developer sub-menu the Allow JavaScript from Apple Events option is ticked.