@ComplexPoint is quite right – by design browser extensions are completely sandboxed from the page-level context Keyboard Maestro has access to, and that safeguard is in place to prevent scripts from doing mischief at the OS level.
Plug-ins also have access to app-level browser features that aren't defined in the JavaScript specification.
However – @MikeTheClicker has demonstrated that magic can happen if you're capable of writing your own browser extension: