Get URL from Edge PWA

Hey all,

I am having some trouble with the get URL action.

I use edge and the PWA's quite extensively. I often need the URL of the PWA I am in and it's not a simple task.

I can create a KM macro that goes into dev tools and pulls the URL out of there, but I was just wondering if I am missing something simple?

Thanks in advance

Was that a statement or a question? You said you "can pull the URL out of there." Or are you asking if that is possible?

Which "get URL" action are you using? This one? This action doesn't get the URL from the current browser. It gets the web page at the specified address, which is different from what I think you are trying to do.

image

Isn't Edge brand new for MacOS, like a month ago? So I don't know much about it. Does it have AppleScript support?

No. It was released on 15 January 2020 or thereabouts.

Yes. It's Chrome-based like Google Chrome and has the same (or very similar) AppleScript suite.

I believe it will work with Keyboard Maestro's Front-Browser actions.

The OP says he wants the URL from the PWA open in Edge – not that he wants to open a URL in it.

The OP (@Danny_Pettiona) should tell us what PWAs he's working with in Edge, so it's possible to test with a similar set-up.

Hey @Danny_Pettiona – I am having the same issue using Edge PWAs so was curious to see if you found a solution here?

PWA is considered a standalone application. URL action only can be used for the browser not PWA. To my knowledge there is no simple way to that in PWA, unless one want to deal with such complexity using additional tool (eg tampermonkey) and programming.

The following is one way.
The following are the steps:

- Use Microsoft Edge “Install As App” to create PWA.

- Install Tampermonkey (https://www.tampermonkey.net/)

- Tampermonkey can inject javascript, so whenever PWA is activated, it can trigger KM macro (eg window.focus event) and pass the current URL to it. Inside the KM macro, it will update the KM global variable, which one can then easily retrieve using Applescript and JXA.

If you are interested in this approach, i can show the code and tampermonkey script setup.

1 Like