How to use Chrome-based actions in standalone Chrome "app"?

In Chrome it's possible to take a webpage and create a standalone "app".

However my various KM Chrome actions (Execute JS in Chrome is the main one I'm using) do not seem to be working in these standalones. Any thoughts on how to get this to work, or if it's possible?

I also tried Execute JavaScript in Front Browser and that didn't seem to work.

Screenshot 2024-05-15 at 8.37.35 AM

Bumping this to the top of the list... any help would be greatly appreciated! Even to know if it's not possible.

Have you tried following the manual's instructions to "Add additional Browsers to Front Browser Actions...", adding the bundle IDs of each of your web apps, then using the "Front Browser" tokens when your app is frontmost?

Go to manual:Single Page Version [Keyboard Maestro Wiki] and scroll down a few screens, or open the page then search for "Add additional Browsers".

I have no idea if this will work... Please report back!

Thanks so much for the pointer. I'll look into that.

So I've spent a couple hours troubleshooting this with help from GPT4, and no success.

The bundle ID I'm adding to my prefs file is com.google.Chrome.app.eaecmalnbllbcapfedeclekffocgacap.

When I try to run Execute JavaScript in Front Browser I get this error: Execute a JavaScript in Front Browser failed with script error: text-script:141:147: script error: Expected end of line, etc. but found identifier. (-2741).

I went through various troubleshooting with Chat GPT, no matter what else I've tried it seems like KM is not able to find the instance of Chrome and pass the js to it.

I'm open to any aditional ideas.

Unfortunately it isn't going to work. The standalone Chrome "app" doesn't have the Chromium AppleScript dictionary, so can't be targeted by KM's AppleScript-dependent Actions or Tokens.

You can see that in this screen shot of two dictionaries -- "Keyboard Maestro Discourse" is a Chrome web app and the "Chromium Suite", including the execute verb, is missing:

The same is true for Safari web apps. It looks like the only solution is to keep using the "standard" browser apps for web sites you want to use "Execute JavaScript" and similar KM actions/tokens on.

Ok, bummer to hear, but good to know.

I hadn't tried doing this with Safari yet, I'm taking a look right now, any input on going that route?

Messed around with this some and it doesn't look like it's possible here either, from what I can see.

Yea; @Nige_S mentioned that after his look at the Chrome web apps:

It seems that neither Chrome nor Safari's web apps support using JavaScript—maybe for security reasons?

-rob.

Have you tried running the code in an HTML Orompt rather than a Web App?

I run a few PHP apps that way with no issues.

Interesting idea, thanks for the input. This doesn't work in my case, primarily b/c the website won't load, saying it's an unsupported browser. Even if it did load the prompt window isn't resizable, which would be a requirement for me.

After messing around with Chrome I've decided to simpy use Safari. Even if having a standalone would make my app organization cleaner, there are some functionality pieces that Safari does that Chrome won't (hiding tab bar, as well as hiding address bar in full screen) that have it work plenty fine for my needs.

Just a note that it is resizable, should you wish to try this again sometime, and you do it by setting the data-kmwindow attribute of the <body> tag in the prompt's HTML -- you can even change it on the fly with JavaScript, though it's certainly not as convenient as just grabbing a corner and dragging.

1 Like

Interesting. It's WebKit, same as Safari, but apparently it doesn't identify itself. I have a popup menu of Web sites I use it with, none of which complain.

As @Nige_S points out, though, the prompt window can be made resizeable. In addition to what he pointed out, the option is in the gear menu of the action itself along with transparency and whether the prompt has a title bar or not.

1 Like

Got it, good to know. Thanks for the help guys, it's appreciated!